TypeScript
The complete path through JavaScript with types: from your first annotation and the everyday types, through narrowing, generics, and types built from other types, to typing the DOM and React, and how the compiler checks your code. Written for learners who already know JavaScript; each lesson pairs a short explanation with code you can run and change.
Why TypeScript?
What TypeScript is, which mistakes it catches before your users see them, and what it costs.
// What you’ll learn
- JavaScript with types
- Bugs caught while you type
- Editor help: autocomplete and rename
- What TypeScript doesn't do
Your progress
View detailed stats- day streak
- 0
- days this week
- 0
- stages done
- 0/10
Recent activity
View allLessons you open and finish, and your quiz scores, show up here.
Next up for you
Quick actions
Recommended for you Based on your progress
- Coming up: Everyday typesStage 2 starts with Primitive types. string, number, boolean, bigint, symbol, null, and undefined, and why they're lowercase.
- Practice in the playgroundWrite and run your own JavaScript, with examples to start from and the console beside it.
- How these lessons are madeThe sources, structure, checks, and Tuto behind every lesson on the path.
The learning path
73 of 73 available10 stages, in order. Each one builds on the last, from your first typed program to the compiler's internals. Jump to a stage, or search for any topic.
- STAGE 1 · BEGINNERGetting started1 module · 4 lessons
- STAGE 2 · BEGINNEREveryday types3 modules · 14 lessons
- STAGE 3 · BEGINNERNarrowing & type safety2 modules · 7 lessons
- STAGE 4 · INTERMEDIATEObjects & classes2 modules · 9 lessons
- STAGE 5 · INTERMEDIATEGenerics1 module · 5 lessons
- STAGE 6 · ADVANCEDTypes from types3 modules · 9 lessons
- STAGE 7 · INTERMEDIATEModules & projects2 modules · 7 lessons
- STAGE 8 · INTERMEDIATETypeScript for the frontend2 modules · 7 lessons
- STAGE 9 · ADVANCEDAdvanced patterns2 modules · 7 lessons
- STAGE 10 · EXPERTUnder the hood1 module · 4 lessons
73 lessons in 10 stages and 19 modules.
Stage 1 Beginner
Getting started
What TypeScript adds to JavaScript, how its compiler works, and your first typed program.
1 module · 4 lessons
- 4 lessons · 1 h 3 min
Module 1: Welcome to TypeScript
Why types help, what the compiler does with them, and how to set up a project.
Stage 2 Beginner
Everyday types
The types you write every day: primitives, arrays, objects, unions, literals, and functions.
3 modules · 14 lessons
- 5 lessons · 1 h 25 min
Module 2: Basic types
Primitives, annotations and inference, and the special types any, unknown, and never.
- 5 lessons · 1 h 22 min
Module 3: Combining types
Unions, literal types, names for types, and the null and undefined rules.
- 4 lessons · 1 h 11 min
Module 4: Functions
Typing parameters and return values, function types, overloads, and this.
Stage 3 Beginner
Narrowing & type safety
How TypeScript follows your checks to know a value's exact type, and how to model data safely.
2 modules · 7 lessons
- 5 lessons · 1 h 26 min
Module 5: Narrowing
Turning a wide type into a precise one with ordinary JavaScript checks.
- 2 lessons · 33 min
Module 6: Assertions & checks
Telling the compiler what you know, and checking a value against a type without losing detail.
Stage 4 Intermediate
Objects & classes
How TypeScript compares object types, describes dictionaries and combinations, and types classes.
2 modules · 9 lessons
- 5 lessons · 1 h 24 min
Module 7: Object types in depth
Structural typing, index signatures, extra property checks, and intersections.
- 4 lessons · 1 h 4 min
Module 8: Classes
Typing class fields and methods, controlling access, and sharing contracts.
Stage 5 Intermediate
Generics
Write functions, types, and classes that work with any type while keeping it precise.
1 module · 5 lessons
- 5 lessons · 1 h 30 min
Module 9: Generics
Type parameters, constraints, defaults, and generics in real frontend code.
Stage 6 Advanced
Types from types
Build new types from existing ones: keyof, indexed access, conditional, mapped, and template literal types.
3 modules · 9 lessons
- 2 lessons · 34 min
Module 10: Type operators
Get a type's keys, a value's type, and the type of a property.
- 4 lessons · 1 h 14 min
Module 11: Conditional & mapped types
Types that choose and types that transform every property.
- 3 lessons · 56 min
Module 12: Utility types
The built-in helper types, how they're written, and how to write your own.
Stage 7 Intermediate
Modules & projects
Types across files and packages: modules, declaration files, and the compiler options that matter.
2 modules · 7 lessons
- 3 lessons · 54 min
Module 13: Modules & declaration files
Importing types, typing JavaScript libraries, and describing globals.
- 4 lessons · 1 h 15 min
Module 14: Configuring TypeScript
The tsconfig.json options that change how strict, what JavaScript, and which files.
Stage 8 Intermediate
TypeScript for the frontend
Types for the code frontend developers write: the DOM, events, fetch, async code, and errors.
2 modules · 7 lessons
- 5 lessons · 1 h 30 min
Module 15: TypeScript in the browser
The DOM's types, events, and data that comes from the network.
- 2 lessons · 42 min
Module 16: TypeScript for UI code
Typing components, state, and the props that flow between them.
Stage 9 Advanced
Advanced patterns
Patterns from real codebases: branded types, type-safe APIs, decorators, and migrating to TypeScript.
2 modules · 7 lessons
- 4 lessons · 1 h 23 min
Module 17: Type-safe patterns
Techniques that make wrong code impossible to write.
- 3 lessons · 1 h 2 min
Module 18: TypeScript in real projects
Moving a codebase to TypeScript and keeping its types healthy.
Stage 10 Expert
Under the hood
How the compiler parses, binds, checks, and emits, and the rules its checker follows.
1 module · 4 lessons
- 4 lessons · 1 h 40 min
Module 19: The compiler
From source text to errors and JavaScript.