Recall & Review
beginner
What happens to TypeScript types after compilation to JavaScript?
TypeScript types are removed during compilation. They do not exist in the JavaScript output because JavaScript does not support static types.
Click to reveal answer
beginner
Do interfaces in TypeScript appear in the compiled JavaScript code?
No, interfaces are only used for type checking during development and are removed during compilation. They do not generate any JavaScript code.
Click to reveal answer
beginner
Which TypeScript features survive compilation to JavaScript?
Features like classes, functions, variables, and control flow statements survive because they have direct JavaScript equivalents.
Click to reveal answer
intermediate
What happens to enums in TypeScript after compilation?
Enums are converted into JavaScript objects with properties representing the enum members, so they survive compilation as usable JavaScript code.
Click to reveal answer
beginner
Why does TypeScript remove type annotations during compilation?
Because JavaScript does not support static typing, type annotations are only for development help and are removed to produce valid JavaScript code.
Click to reveal answer
What happens to TypeScript type annotations after compilation?
✗ Incorrect
Type annotations are removed because JavaScript does not support static types.
Which of these survives compilation from TypeScript to JavaScript?
✗ Incorrect
Classes have direct JavaScript equivalents and survive compilation.
How are TypeScript enums represented in compiled JavaScript?
✗ Incorrect
Enums are compiled into JavaScript objects mapping enum names to values.
Do TypeScript interfaces generate any JavaScript code?
✗ Incorrect
Interfaces are only for type checking and are removed during compilation.
Why does TypeScript remove type information during compilation?
✗ Incorrect
JavaScript does not have static types, so type info is removed to produce valid JS.
Explain what parts of TypeScript code remain after compilation to JavaScript and why.
Think about what JavaScript can run and what is only for development.
You got /4 concepts.
Describe how TypeScript enums are transformed in the compiled JavaScript output.
Consider how enums can be used after compilation.
You got /3 concepts.