TypeScript
Advanced Types
Learn generics, discriminated unions and utility types, and see how the type system becomes a tool for designing your program.
Start the trackFree, no sign-up needed
What you'll learn
- GenericsThe return type follows the input type
- Generic constraintsRequire only what you need
- Indexed access with keyofA key that exists and a value of the right type
- Deriving typesOne type that all the others come from
- Discriminated unionsAn impossible state can't be written
- Covering every caseA forgotten case stops the build
- Type guardsFrom unknown to a type you can trust
- Looping over keysA type built from another type's keys
- as const and satisfiesCheck the shape without widening the type
- Promise typesEvery await gets its own type
Track contents
10 lessons, 2 hours in total- 1GenericsTypeScriptThe return type follows the input type13 min
- 2Generic constraintsTypeScriptRequire only what you need12 min
- 3Indexed access with keyofTypeScriptA key that exists and a value of the right type13 min
- 4Deriving typesTypeScriptOne type that all the others come from14 min
- 5Discriminated unionsTypeScriptAn impossible state can't be written13 min
- 6Covering every caseTypeScriptA forgotten case stops the build13 min
- 7Type guardsTypeScriptFrom unknown to a type you can trust14 min
- 8Looping over keysTypeScriptA type built from another type's keys14 min
- 9as const and satisfiesTypeScriptCheck the shape without widening the type13 min
- 10Promise typesTypeScriptEvery await gets its own type15 min