Now on Omarchy: read the manual without leaving your desktop
All practice

TypeScript Practice

Hands-on TypeScript lessons - add types to real JavaScript, run them instantly, and get checked by real tests.

Basic 0/12 complete

TypeScript Practice

Twelve short, hands-on TypeScript lessons: start with basic type annotations, build up through interfaces, function types, union types, and generics, work through a capstone and a real runtime bug - then go deeper with lessons 8-12: narrowing with in and instanceof, discriminated unions, exhaustiveness checking with never, generic constraints, and a generic Stack<T> class. Each lesson gives you a task and a Run button - your code is checked against real tests the moment you run it. Everything runs in your browser: your TypeScript is stripped down to plain JavaScript on the fly, so what runs is exactly what your annotations describe.

Start with lesson 1. You can leave and come back any time - your code is saved locally.

Lessons

12 total
  1. 01 Type annotations
  2. 02 Interfaces
  3. 03 Function types and default params
  4. 04 Union types and narrowing
  5. 05 Generics
  6. 06 Capstone: typed inventory lookup
  7. 07 Fix the bug: sorting numbers
  8. 08 Narrowing with in and instanceof
  9. 09 Discriminated unions
  10. 10 Exhaustiveness with never
  11. 11 Generic constraints
  12. 12 A generic class (capstone)