Free TypeScript Tutorials
25 free, hands-on TypeScript lessons from first lines of code to advanced patterns. Run every example directly in your browser — no install, no signup.
basics
Introduction to TypeScript
Start learning TypeScript from scratch. Understand why TypeScript improves JavaScript with static types for scalable applications.
Variables and Types
Learn TypeScript variables and type annotations. Master the type system including unions, literals, and type inference for safer code.
Functions
Learn how to write typed functions in TypeScript with optional parameters, overloads, and return types for safer, documented code.
Control Flow
Learn TypeScript control flow and type narrowing. Use typeof guards and exhaustive checks to write safer conditional logic.
Data Structures
Learn typed arrays, tuples, and objects in TypeScript. Build type-safe data structures with interfaces, readonly, and generics.
Enums And Constants
Learn TypeScript enums and const assertions to create named, type-safe constants. Replace magic strings and numbers in your code.
Config And Tsconfig
Learn tsconfig.json to configure your TypeScript project. Master strict mode, compiler targets, path aliases, and essential flags.
intermediate
Interfaces and Types
Master TypeScript interfaces and type aliases. Learn extending, intersection types, declaration merging, and when to use each.
Generics
Write reusable, type-safe code with TypeScript generics. Learn generic functions, interfaces, classes, and constraints.
Modules
Organize TypeScript code with ES modules. Learn named exports, default exports, type-only imports, re-exports, and barrel files.
Error Handling
Learn robust TypeScript error handling with try/catch, custom error classes, the Result pattern, and type narrowing for caught errors.
Utility Types
Master TypeScript utility types like Partial, Pick, Omit, and Record. Transform existing types without repetition.
Type Narrowing
Learn TypeScript type narrowing with typeof, instanceof, in operator, discriminated unions, and user-defined type guards.
Classes And OOP
Learn TypeScript classes and OOP with constructors, inheritance, access modifiers, and interfaces for type-safe object-oriented code.
Async TypeScript
Master async/await in TypeScript with typed Promises, async functions, and error handling patterns for non-blocking, readable code.
Type-Safe APIs
Build type-safe APIs in TypeScript with generic fetch wrappers, discriminated union responses, and runtime type guards.
Debugging TypeScript
Learn to read TypeScript error messages, use the type system for debugging, write exhaustiveness checks, and apply runtime techniques.
advanced
Decorators
Learn TypeScript decorators to add metadata and behavior to classes, methods, and properties. Used in Angular, NestJS, and TypeORM.
Testing
Write type-safe tests in TypeScript with assertion patterns, mocking, and test organization for reliable, maintainable test suites.
React and TypeScript
Type React components, props, hooks, events, and context with TypeScript. Catch UI bugs at compile time and build self-documenting code.
Advanced Patterns
Master advanced TypeScript patterns: discriminated unions, template literal types, conditional types, infer, and branded types.
Capstone Project
Build a type-safe task management system combining generics, discriminated unions, utility types, and advanced TypeScript patterns.
Zod And Validation
Learn Zod for runtime schema validation in TypeScript. Parse untrusted data safely and infer types from schemas automatically.
Mapped Types
Learn TypeScript mapped types to transform, filter, and reshape types programmatically. Build your own Partial, Required, and Readonly.
Next.js and TypeScript
Apply TypeScript to Next.js patterns including typed page props, API responses, server actions, and generic data fetching.