From type annotations and inference through union types, narrowing, generics, classes and utility types, all the way to async code and the DOM. Fifty lessons that take you to the point where you find your mistakes before you run anything. Every piece of code and every tsc output shown was produced by actually running it.
The 50 lessons are grouped into seven chapters. Working through them in order is the best way, but you are welcome to dip into whatever interests you. Note: the in-page editor simply strips the types and runs the result, so real type errors are shown as tsc output instead.
You get a feel for what TypeScript takes off your hands by writing the same logic side by side with JavaScript. Setting up, tsconfig.json, type annotations and inference, and how to get by without any.
Arrays, objects, union and intersection types, and naming types with type and interface. You go far enough to narrow a union type, which otherwise only lets you use what its members have in common.
Parameters and return values, callbacks and overloads — a full pass over the types around functions. Type guard and assertion functions make your own checks narrow types too.
You write functions that take a type the way they take an argument and hand that same type back. Combining keyof, typeof and indexed access types, you finish by building a type-safe storage helper.
Property declarations, access modifiers, inheritance and implements — the types around classes. Then .d.ts files and @types, for using untyped JavaScript safely.
You use the built-in types — Partial, Pick, Omit, Record — to derive purpose-built types from a single source type. The second half is how they are made: mapped types, conditional types, infer and satisfies.
Modules, async code, validating fetch responses, error handling and the DOM. You finish by assembling a to-do app and seeing what happens when you change a single word in a type definition.
Once you have finished all 50 lessons, move on to the framework side with Next.js. Membership unlocks every course.