TypeScript · Junior · Question 1 of 75
What is TypeScript?
- ✓Correct answer: A superset of JavaScript with static typing that compiles to JS
- 2A separate language with its own runtime that browsers execute directly
- 3A library for checking types while JavaScript code runs
Explanation
Any valid JS is almost always valid TS. Types are checked at compile time and then erased: plain JavaScript runs at runtime, and there are no type checks there. That's why external data (APIs, forms) is still validated at runtime - e.g. with Zod.