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.
- Hello, TypeScript 15 min · Read, predict, check and run
- Types & Inference 17 min · Read, predict, check and run
- Compiler Errors 18 min · Read, predict, check and run
- Checkpoint: Study Receipt 25 min · Independent practice
Day 2 · About 75 minutes
Functions & Object Types
Describe reusable function contracts and records with optional data.
- Function Types 15 min · Read, predict, check and run
- Object Types & Aliases 18 min · Read, predict, check and run
- Optional Properties & Interfaces 17 min · Read, predict, check and run
- Checkpoint: Session Labels 25 min · Independent practice
Day 3 · About 80 minutes
Unions, Narrowing & Null
Model alternatives and handle absent values with real evidence.
- Union & Literal Types 17 min · Read, predict, check and run
- Type Narrowing 20 min · Read, predict, check and run
- Null & Undefined 18 min · Read, predict, check and run
- Checkpoint: Parse Minutes 25 min · Independent practice
Day 4 · About 80 minutes
Arrays, Records & Readonly
Handle missing lookups and summarize collections without mutation.
- Arrays & Safe Lookup 17 min · Read, predict, check and run
- Records & Dynamic Keys 20 min · Read, predict, check and run
- Readonly Data 18 min · Read, predict, check and run
- Checkpoint: Weekly Summary 25 min · Independent practice
Day 5 · About 75 minutes
Generics & Reusable Functions
Preserve useful type relationships without losing domain information.
- Generic Functions 17 min · Read, predict, check and run
- Generic Constraints 20 min · Read, predict, check and run
- Utility Types & Typed Callbacks 13 min · Read, predict, check and run
- 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.
- unknown & Type Guards 17 min · Read, predict, check and run
- Runtime Validation 15 min · Read, predict, check and run
- JSON & Result Types 18 min · Read, predict, check and run
- 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.
- Capstone: Study Planner 15 min · Read, predict, check and run
- Type Checks & Runtime Tests 15 min · Read, predict, check and run
- Running TypeScript Locally 10 min · Read, predict, check and run
- Extending the Planner 15 min · Read, predict, check and run
- On Your Own: Reading Progress 20 min · Independent practice
- Come Back Later: Review Challenges 20 min · Return in a few days · extra practice