Skip to content

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 90 minutes on Days 1–6 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 →

Study by explaining, repairing, and building

Days 1–6 each budget about 90 minutes, including a debugging exercise and an independent checkpoint. Split a day into two sessions if needed. These are planning estimates; take longer whenever you need to rebuild an idea.

Predict a worked example before running it. Trace the contract in your own words, repair the day's plausible mistake, then close the examples and attempt the checkpoint. Use its acceptance cases to test a boundary as well as an ordinary input.

After checking a solution, change the input and explain why your version still works. Begin your next session by rebuilding a small part from memory. Day 7 combines the ideas in a project; Come Back Later adds delayed practice and a readiness check for your next step.

Day 1 · About 90 minutes

Types, Inference & Compiler Errors

Separate type checking from execution and diagnose simple mistakes.

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

Day 2 · About 90 minutes

Functions & Object Types

Describe reusable function contracts and records with optional data.

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

Day 3 · About 90 minutes

Unions, Narrowing & Null

Model alternatives and handle absent values with real evidence.

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

Day 4 · About 90 minutes

Arrays, Records & Readonly

Handle missing lookups and summarize collections without mutation.

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

Day 5 · About 90 minutes

Generics & Reusable Functions

Preserve useful type relationships without losing domain information.

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

Day 6 · About 90 minutes

Unknown Data & Runtime Validation

Turn unknown JSON into trusted records with explicit failure results.

  1. unknown & Type Guards 25 min · Read, predict, check and run
  2. Runtime Validation 20 min · Read, predict, check and run
  3. JSON & Result Types 20 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