Description
Coding
TypeScript foundations
Build on basic JavaScript with 32 lessons about types, safe functions, structured data, and practical TypeScript projects.
Connect object types, model distinct states, validate input, and build a typed practice planner.
- 1
Interfaces as contracts
Use structural typing to pass compatible data through a small interface.
14 min
- 2
Composing object types
Extend a shared interface and combine independent object requirements.
14 min
- 3
Discriminated unions
Model distinct states and narrow them with a shared literal property.
14 min
- 4
Exhaustive state checks
Use never to make an omitted union case a compile-time error.
14 min
- 5
Generic constraints
Require the properties a generic function uses while preserving its input type.
14 min
- 6
Keys and safe property access
Use keyof to limit a key to the properties of a particular object.
14 min
- 7
Indexed access types
Reuse property and array-element types instead of duplicating their definitions.
14 min
- 8
Practical utility types
Use Pick, Omit, Partial, and Record to describe everyday data shapes.
14 min
- 9
Validating unknown data
Check untrusted fields at runtime before treating a value as a typed record.
14 min
- 10
Project: a typed practice planner
Combine runtime validation and discriminated results in a small practice planner.
20 min