TypeScript / Beginner · Free and public

Learn TypeScript in 7 Days

Make your JavaScript contracts explicit. Read actual compiler errors, validate unknown data, and migrate a familiar program one step at a time.

Start Day 1 →

New to TypeScript, comfortable with JavaScript

You should know variables, functions, arrays, objects, loops and conditions. No promises or advanced JavaScript required. Learn those basics first if needed.

30 lessons across seven modules. Plan around 60–90 minutes per day for worked explanations, prediction, contrasting cases and independent practice; the exact suggested total appears below each day. Delayed review is extra. These are suggested active-study budgets, not deadlines.

Editors check your code with TypeScript 5.9.3 in your browser. Errors include real compiler codes and locations. Check types first, then check and run. Compiler errors block execution. Console programs run separately in workers; webpage DOM and multi-file imports belong in a local project.

Use hints before solutions, change the inputs, and return to older exercises. Completion stays in this browser. No installation is needed for the lessons; Day 7 includes an optional downloadable project with local commands and tests.

Comfortable with these contracts? Continue with intermediate TypeScript →

Day 1 · About 75 minutes

Types, Inference & Compiler Errors

Separate type checking from execution and diagnose simple mistakes.

  1. Hello, TypeScript 15 min · Read, predict, check and run
  2. Types & Inference 17 min · Read, predict, check and run
  3. Compiler Errors 18 min · Read, predict, check and run
  4. Checkpoint: Study Receipt 25 min · Independent practice

Day 2 · About 75 minutes

Functions & Object Types

Describe reusable function contracts and records with optional data.

  1. Function Types 15 min · Read, predict, check and run
  2. Object Types & Aliases 18 min · Read, predict, check and run
  3. Optional Properties & Interfaces 17 min · Read, predict, check and run
  4. Checkpoint: Session Labels 25 min · Independent practice

Day 3 · About 80 minutes

Unions, Narrowing & Null

Model alternatives and handle absent values with real evidence.

  1. Union & Literal Types 17 min · Read, predict, check and run
  2. Type Narrowing 20 min · Read, predict, check and run
  3. Null & Undefined 18 min · Read, predict, check and run
  4. Checkpoint: Parse Minutes 25 min · Independent practice

Day 4 · About 80 minutes

Arrays, Records & Readonly

Handle missing lookups and summarize collections without mutation.

  1. Arrays & Safe Lookup 17 min · Read, predict, check and run
  2. Records & Dynamic Keys 20 min · Read, predict, check and run
  3. Readonly Data 18 min · Read, predict, check and run
  4. Checkpoint: Weekly Summary 25 min · Independent practice

Day 5 · About 75 minutes

Generics & Reusable Functions

Preserve useful type relationships without losing domain information.

  1. Generic Functions 17 min · Read, predict, check and run
  2. Generic Constraints 20 min · Read, predict, check and run
  3. Utility Types & Typed Callbacks 13 min · Read, predict, check and run
  4. Checkpoint: Reusable Lookup 25 min · Independent practice

Day 6 · About 75 minutes

Unknown Data & Runtime Validation

Turn unknown JSON into trusted records with explicit failure results.

  1. unknown & Type Guards 17 min · Read, predict, check and run
  2. Runtime Validation 15 min · Read, predict, check and run
  3. JSON & Result Types 18 min · Read, predict, check and run
  4. Checkpoint: Session Import 25 min · Independent practice

Day 7 · About 75 minutes

Capstone: A Typed Study Planner

Migrate, test and extend a familiar JavaScript core, then solve a fresh brief.

  1. Capstone: Study Planner 15 min · Read, predict, check and run
  2. Type Checks & Runtime Tests 15 min · Read, predict, check and run
  3. Running TypeScript Locally 10 min · Read, predict, check and run
  4. Extending the Planner 15 min · Read, predict, check and run
  5. On Your Own: Reading Progress 20 min · Independent practice
  6. Come Back Later: Review Challenges 20 min · Return in a few days · extra practice