JavaScript With a Type System
- What TypeScript is. TypeScript is JavaScript plus a type layer: the same language, with every value’s shape written down and checked.
- Why teams adopt it. Types turn silent runtime surprises into compile-time errors: the bug is caught while you are still typing.
- Types are erased. Types are erased at build time: the emitted JavaScript carries no trace of them, so nothing slows at runtime.
Compile Time vs Runtime
- Two worlds. TypeScript lives in two worlds: compile time where types are checked, and runtime where only JavaScript exists.
- The compiler. The compiler tsc reads your annotated source, reports contradictions, and emits plain JavaScript.
- What types cannot see. A network response arrives at runtime: a type annotation alone cannot prove what actually came over the wire.
Before and after this level
- Before: nothing. This is where the course starts.
- Next: Level 1: TypeScript Foundations: Primitive Types and Inference, Variables, Functions and Objects, Reading TypeScript.
In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.
Frequently asked questions
What does TypeScript: Start Here: Why TypeScript Exists cover?
JavaScript With a Type System, Compile Time vs Runtime: 2 lessons and 6 ideas.
Is this level free?
Yes. Start Here: Why TypeScript Exists is the free first level of the TypeScript course, with its checkpoint and flashcards.