TypeScript Tutorial
TypeScript (TS) is a superset of JavaScript: almost all valid JavaScript is valid TypeScript, plus static types. Code is compiled to JavaScript first, then run in the browser or Node.
Recommended path: finish the JavaScript tutorial first, then this track. TypeScript does not invent a new syntax — it adds types on top of JS. Skipping JS makes later lessons hard to follow. This tutorial targets TypeScript 5 and goes deeper than a cheat sheet: each lesson has explanations, comparison tables, pitfalls, practical snippets, and short exercises.
Types are erased after compile; at runtime you still have plain JavaScript. This site’s playground does not type-check — use VS Code or tsc to see errors.
Learning path
Start
The type system
- Objects: interface and type
- Unions and narrowing
- Arrays and tuples
- keyof and indexed access types
- Mapped types
- Generics
- Utility types
- Conditional types and infer
- Type guards and assertions
- Enums and as const
Async and projects
Next: What is TypeScript
