TypeScript · Exercise 6 of 6 Previous
Intermediate
Rewrite for Type Stripping
This file's tsconfig turns on erasableSyntaxOnly, so it can run under Node's built-in type stripping. The enum and the constructor parameter properties (public name) are not allowed.
Rewrite the file without them: a const object plus a type for Role, and a class with explicit fields. It must still print Asha 0.
What Check tests
- Your code has no type errors
- The console prints
Asha 0 - There is no
enum - The constructor has no
public,private,protectedorreadonlyparameters
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Press Run to see the page.
Console
Nothing printed yet.