Quiz · 3 questions
🏛️ Classes — OO in TypeScript
Syntax, access modifiers, abstract, static, parameter properties, TC39 decorators
Level 0Curious
0 XP0/93 lessons0/23 achievements
0/100 XP to next level100 XP to go0% complete
Quiz
01What's the difference between
private and #private?Hint
Try accessing
obj['secret'] for both forms. The TypeScript private compiles fine; the JS private throws or returns undefined.02What do parameter properties do?
Hint
Without parameter properties, you'd write the field declaration, the constructor parameter, and the assignment separately. Parameter properties collapse all three.
03What's the difference between TC39 decorators and the older TypeScript experimentalDecorators?
Hint
Check your tsconfig — if
experimentalDecorators: true is set, you're on the older version. Without that flag, TypeScript 5+ uses Stage 3.Comments 0
🔔 Reply notifications (sign in)Sign in — Please sign in to comment.
No comments yet — be the first.