Lessons
What TypeScript is and how to set it up
TypeScript as a JS superset, tsc compiler, tsconfig basics, and the key principle: types are erased at compile time.
What to look for:
- TypeScript is a superset — all valid JS is valid TS
- Types are erased: zero runtime overhead
- tsc --init to generate tsconfig
- The Curious tab only for now
Basic types and type annotations
string, number, boolean, null, undefined, any vs unknown, arrays, tuples, and type inference.
What to look for:
- Type inference — you don't need to annotate everything
- any vs unknown — prefer unknown, it requires narrowing
- Union types string | number
- The literal types section: "north" | "south"
Interfaces and type aliases
interface vs type alias, optional and readonly properties, extending interfaces, and structural typing.
Prerequisite: Lesson 2
What to look for:
- The interface User example — optional ? and readonly
- Structural typing — shape matters, not name
- Discriminated unions — the kind field pattern
- interface extends vs type &
Union types and type narrowing
Narrowing with typeof, instanceof, in, discriminated unions, user-defined type guards, and never.
Prerequisite: Lesson 3
What to look for:
- The Exploring tab — narrowing section
- typeof / instanceof / in — each narrows differently
- User-defined type guard: value is string return type
- never — unreachable code branches
Functions with TypeScript
Parameter types, return types, optional parameters, rest params, overloads, and function type signatures.
Prerequisite: Lessons 1-4
What to look for:
- Function type signatures (param: type): ReturnType
- Optional parameters — must come after required
- void vs undefined return type
- The Formatter interface example — function type in interface
How to use this track: Each lesson links to the Codex reference page. Use reading level tabs. Check "What to look for". Come back here for the quiz.
Track quiz
4 questions on the Foundations track.
What happens to TypeScript types at runtime?
What is the difference between any and unknown?
What makes TypeScript "structural" rather than "nominal"?
What does the ? in interface User { age?: number } mean?