Learn Intermediate TypeScript
Take TypeScript further: set it up with editors, tsc and tsconfig.json, type classes with access modifiers and readonly fields, narrow with type predicates and discriminated unions, and write generic classes and functions with defaults, constraints and keyof.
- Intermediate level
- 4 modules
- 23 lessons
- 103 tasks and questions
Syllabus
01TypeScript ConfigurationSet TypeScript up for real work: how editors use it, running tsc on the command line, adding TypeScript to a project with npm and tsconfig.json, and the compiler options and comment directives you'll meet most.5 lessons
02TypeScript Class TypesType your classes: annotate fields and constructors, control access with public, private and protected, protect data with readonly, and shorten classes with parameter properties.6 lessons
03Intermediate Type NarrowingTeach TypeScript about your own checks: write type predicates, narrow with equality checks against literals, null and undefined, model data as discriminated unions, and let the compiler prove every case is handled.6 lessons
04TypeScript GenericsGo further with generics: write generic classes, give type parameters defaults, constrain them with extends, and use keyof to work safely with property names.6 lessons