Practice

TypeScript Practice

Basic

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

TypeScript Practice

Six short, hands-on TypeScript lessons: start with basic type annotations, build up through interfaces, function types, union types, and generics, then finish with a capstone that combines them. 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

  1. Type annotations
  2. Interfaces
  3. Function types and default params
  4. Union types and narrowing
  5. Generics
  6. Capstone: typed inventory lookup