TypeScript from Zero

A complete TypeScript course for people who have never written a line of code, in three levels.

type Course = Level1 | Level2 | Level3;

Explore learning paths

type Course = Level1 | Level2 | Level3;

Three levels, each a type of its own

Start at the level that matches you. Hover or tap a level to type-check its fields: who it is for, how long it takes and what you build.

name:

TypeScript Foundations

tagline:
Programming from scratch
for:
People with no programming experience. Nothing is assumed.
hours:
45‑60 hours
modules:
15 modules
project:
TaskKit — A command-line task manager that gains one feature in every module.
access:
Free
Start Level 1 Free
name:

Practical TypeScript

tagline:
Everyday power of the type system
for:
Level 1 graduates, or people who already program a little. A placement quiz tells you where to start.
hours:
55‑70 hours
modules:
18 modules
project:
Typed API client — A command-line client for a public web API with validated responses, a disk cache, Result-based errors, and full tests.

Coming soon. Not open yet: the fields above are what it will cover.

Expected$99 · Q2 2027
See Level 2
name:

Advanced TypeScript

tagline:
Type-level mastery and TypeScript at scale
for:
Developers with real TypeScript experience: confident Level 2 graduates, mid-level and senior engineers, tech leads. A placement quiz tells you where to start.
hours:
55‑70 hours
modules:
18 modules
project:
Typed toolkit — A small type-safe library (schemas, typed routes, and events) built up in Part A and hardened for real-world use in Part B.

After Level 2. Not open yet: the fields above are what it will cover.

Expected$119 · Q4 2027
See Level 3

modules.length === 51

51 modules, sorted by level

Hover, focus or tap a module to read its lessons.

Level1TypeScript Foundations15 modules

(module) 1.1 Getting Started

  • What a program is and how a computer runs it
  • Your setup: VS Code, Node.js, and basic terminal commands
  • Hello, world: running your first .ts file (and the online Playground)
  • and 3 more lessons

project: Print a TaskKit welcome banner.

(module) 1.2 Values and Variables

  • const and let
  • Basic types: string, number, boolean
  • Arithmetic, comparisons, and template strings
  • and 5 more lessons

project: TaskKit reads a command and a task name from the command line.

(module) 1.3 Conditions and Missing Values

  • if / else and switch
  • Logical operators, truthy and falsy values
  • null and undefined
  • and 2 more lessons

project: Validate input and print helpful messages.

(module) 1.4 Arrays and Loops

  • Arrays and the T[] type
  • for, for...of, and while
  • map, filter, find, some, and every
  • and 4 more lessons

project: Keep tasks in a list, refuse a task typed twice, and sort them A to Z.

(module) 1.5 Functions

  • Declaring functions: parameter and return types
  • Arrow functions
  • Optional, default, and rest parameters
  • and 8 more lessons

project: Refactor TaskKit into small, tested functions.

(module) 1.6 Objects and Collections

  • Objects and object types
  • Optional and readonly properties
  • Type aliases (type)
  • and 7 more lessons

project: Tasks become objects with an id, a title, and an optional due date.

(module) 1.7 Unions and Narrowing

  • Union types
  • Literal types and unions of literals ("todo" | "done")
  • Narrowing with typeof, equality, and truthiness
  • and 3 more lessons

project: Task status becomes a union; commands become a discriminated union.

(module) 1.8 Errors and Debugging

  • A catalogue of common TypeScript errors and how to fix them
  • Type errors vs runtime errors: why types vanish when the code runs
  • throw and try / catch
  • and 3 more lessons

project: Friendly error messages for bad commands.

(module) 1.9 Modules, Packages, and Projects

  • import and export: "type": "module", .ts extensions, import type
  • npm and package.json: installing packages and writing scripts
  • Types for packages: @types and the types setting
  • A ready-made tsconfig.json: strict, and the flags that keep TypeScript in sync with Node

project: Split TaskKit into modules and add check, test, and start scripts.

(module) 1.10 Reading Generic Types

  • What <T> means: Array<T> and Map<K, V>
  • Your first generic function

project: Store tasks in a Map<string, Task> and write a generic findBy helper.

(module) 1.11 Asynchronous Code

  • What asynchronous code is and why it exists
  • The event loop, in pictures
  • Promise<T>
  • and 3 more lessons

project: Add a delay() helper and a reminder that waits before it prints.

(module) 1.12 Talking to the Outside World

  • JSON: parse and stringify, and why JSON.parse returns any
  • Reading and writing files: readFile and writeFile
  • Interactive input with readline
  • and 2 more lessons

project: Save tasks to a JSON file; add an interactive mode.

(module) 1.13 Classes: The Basics

  • Classes: properties, constructors, and methods
  • private, #private, and readonly: TypeScript privacy vs JavaScript privacy
  • When to use classes, and when functions and objects are enough

project: Move task storage into a TaskStore class with #private data and public methods.

(module) 1.14 Popular Libraries, Step One

  • Why libraries exist, and how to choose one: popularity, maintenance, built-in types or @types
  • Staying safe: lockfiles, pinned versions, and what a supply-chain attack is
  • chalk: colors in the terminal
  • and 3 more lessons

project: TaskKit gets colored output, proper commands, and due dates.

(module) 1.15 Final Project

  • Finish TaskKit: add a feature that fetches data from an API, and write a README
  • Git on your computer: commits and a .gitignore
  • Ship TaskKit: publish it on GitHub with a README and a short demo recording
  • Self-assessment: are you ready for Level 2?

project: Ship TaskKit: publish it on GitHub with a README and a short demo recording.

Level2Practical TypeScript18 modules

(module) 2.1 TypeScript's Own Tools

  • tsc: --noEmit, --watch, and reading its output
  • Your editor as a TypeScript tool: hover, go to definition, rename, quick fixes
  • Reading long, nested type errors
  • Strict flags beyond strict: what each one catches and which to turn on

project: Start the API client: strict flags, plus check and watch scripts.

(module) 2.2 Harder Narrowing Cases

  • Exhaustiveness checking with never
  • Type guards (x is T), and when TypeScript infers them for you
  • Assertion functions (asserts x is T)
  • and 2 more lessons

project: Model the client's commands as a union and handle every case exhaustively.

(module) 2.3 Type Operators

  • Intersection types (&): combining shapes, and how they differ from extends
  • The wide types: unknown, object, and {}
  • keyof
  • and 6 more lessons

project: Derive command names and option types from one as const config checked with satisfies.

(module) 2.4 Generics in Practice

  • Constraints with extends
  • The K extends keyof T pattern
  • Default type parameters
  • Generic classes and containers

project: Write a generic request<T>() helper and a typed cache Cache<K, V>.

(module) 2.5 Built-in Utility Types

  • Partial, Required, Readonly; a missing property vs undefined
  • Pick, Omit, Record
  • Exclude, Extract, NonNullable
  • ReturnType, Parameters, Awaited

project: Build create, update, and summary types from one base type.

(module) 2.6 Immutability and Tuples

  • readonly arrays and ReadonlyArray<T>
  • Named, optional, and rest elements in tuples
  • Updating without mutating: toSorted, with, and structuredClone

project: Make settings and cache entries read-only; return new objects instead of changing old ones.

(module) 2.7 Designing with Types

  • Making impossible states impossible
  • Modeling loading, success, and error states
  • Branded types for IDs and units
  • and 2 more lessons

project: Model each request as idle, loading, success, or error, and brand the IDs.

(module) 2.8 Advanced Functions

  • Function overloads
  • Typing this, and how methods lose their context
  • Generic callbacks and higher-order functions
  • Iterables and generators: function* and Generator<T>

project: Add an overloaded get() and a generator that pages through results.

(module) 2.9 Classes in Depth

  • implements and abstract
  • Getters, setters, and static members
  • protected, and why modern code avoids parameter properties
  • Composition vs inheritance

project: Hide HTTP behind an interface with two classes: a real client and a fake one.

(module) 2.10 Errors and Concurrent Code

  • Custom error classes and cause
  • The Result pattern instead of exceptions
  • Promise.all, allSettled, race, any, and their types
  • and 2 more lessons

project: Return Results instead of throwing; add timeouts, cancellation, and parallel requests.

(module) 2.11 Data at App Boundaries

  • Why types don't protect you at runtime
  • Writing validators by hand with type guards
  • Typing and validating API responses
  • and 2 more lessons

project: Validate every API response with hand-written guards before it enters the app.

(module) 2.12 Standard Library Essentials

  • Regular expressions: the basics, and typed match results
  • Intl: formatting numbers, currencies, and dates for any language
  • Dates and times: Date pitfalls and Temporal
  • The rarer primitives: bigint and symbol

project: Format prices, dates, and numbers for the user's locale; parse fields with regex.

(module) 2.13 How TypeScript Finds and Runs Code

  • tsconfig.json in detail: target, module, rootDir, outDir, lib, types
  • Module resolution: nodenext or bundler, and how to choose
  • ESM and CommonJS: what you'll meet in other people's code
  • and 2 more lessons

project: Reorganize the client into folders with a clear public API and build it with tsc.

(module) 2.14 Untyped Code

  • Libraries without types: declare module
  • Ambient declarations, global types, and .d.ts files
  • Namespaces: recognizing an older pattern
  • If you end up in a JavaScript project: allowJs, checkJs, and JSDoc

project: Add a small untyped helper package and describe it with your own .d.ts file.

(module) 2.15 Reviewing TypeScript Code

  • Type-safety smells: any, as, !, @ts-ignore, and a switch that isn't exhaustive
  • Reading unfamiliar TypeScript
  • Reviewing AI-generated TypeScript with the same checklist

project: Review your own client with the smell checklist and fix what you find.

(module) 2.16 Testing Typed Code

  • Structuring tests with node:test; typed fixtures and test data builders
  • Testing asynchronous code
  • Typed test doubles without a framework

project: Cover the client with tests, using the fake HTTP class from Module 9.

(module) 2.17 Popular Libraries, Step Two

  • zod: schemas that become types, compared with your hand-written validators
  • axios: typed HTTP requests, and why get<User>() is a promise, not a check
  • ts-pattern: exhaustive pattern matching over unions
  • vitest: moving your node:test suite to a popular test framework

project: Replace hand-written guards with Zod, try axios, and move the tests to Vitest.

(module) 2.18 Final Project

  • A typed command-line API client: validated responses (by hand, then with Zod), a disk cache, Result-based errors, and full tests

project: Ship the client: a README, a clean check run, and tests for every core feature.

Level3Advanced TypeScript18 modules

(module) 3.1 How the Type System Works

  • Structural typing and assignability
  • Top and bottom types: unknown and never
  • Widening, literal freshness, and the limits of control-flow analysis
  • and 2 more lessons

project: Start the toolkit: sketch its public types and predict which assignments must fail.

(module) 3.2 Testing and Debugging Types

  • @ts-expect-error as a test
  • Writing your own Equal and Expect helpers
  • Debugging complex types: hover tricks and Prettify

project: Set up type tests with Equal and Expect; every later feature ships with them.

(module) 3.3 Conditional Types

  • Conditional type syntax
  • Distributive conditional types
  • infer: extracting types
  • Filtering and transforming unions

project: Add Infer<Schema>, which extracts the value type from a schema.

(module) 3.4 Mapped Types

  • Homomorphic mapped types
  • + / - modifiers
  • Key remapping with as

project: Turn object schemas into types with optional and read-only fields.

(module) 3.5 Template Literal Types

  • Template literal type syntax
  • Uppercase, Capitalize, and other intrinsic string types
  • Extracting parts of strings: from "/users/:id" to { id: string }

project: Add a typed route helper that extracts params from "/users/:id".

(module) 3.6 Recursive Types

  • Recursive type aliases: JSON and trees
  • DeepPartial and DeepReadonly
  • Path types ("user.address.city")
  • Recursion depth limits

project: Support nested schemas and deep paths like "user.address.city".

(module) 3.7 Building Your Own Type Utilities

  • Pick, Omit, and ReturnType from scratch
  • UnionToIntersection, IsEqual, and IsAny
  • Readable type errors for the people who use your types
  • Practice set: type-level challenges

project: Write the toolkit's own helpers and give common misuse a readable error.

(module) 3.8 Advanced Generics

  • How inference picks T
  • const type parameters
  • NoInfer and controlling inference sites
  • and 3 more lessons

project: Make the API keep literal types with const parameters and NoInfer.

(module) 3.9 Popular Libraries, Step Three: Reading Their Types

  • How to read a .d.ts file you didn't write
  • Case study: how TypeScript types its own standard library (Array.map, Object.entries, Promise.all)
  • type-fest: ready-made utility types, compared with the ones you wrote
  • and 3 more lessons

project: Compare your schema design with Zod's and record three decisions you would change.

(module) 3.10 Type-Safe API Design

  • Builder and fluent APIs, and the polymorphic this type
  • A type-safe event emitter
  • Type-level state machines
  • The cost of cleverness: when type-level magic hurts

project: Add a fluent schema builder and a typed event emitter for validation events.

(module) 3.11 Extension and Metaprogramming

  • Declaration merging
  • Module augmentation
  • Decorators (TC39 standard), and why they need a build step today
  • using and explicit resource management

project: Let users register custom validators through declaration merging.

(module) 3.12 Architecture with Types

  • Module boundaries: designing a module's public types
  • Dependency injection with plain functions and interfaces
  • Extensible registries: letting users add types to your library (the Register interface pattern)
  • Typed errors across layers: domain, application, and transport

project: Split the toolkit into a core and plugins with clear public types.

(module) 3.13 Types from Outside

  • Generating types from OpenAPI and JSON Schema
  • Types from database schemas
  • Keeping generated and hand-written types in sync

project: Generate schemas from an OpenAPI description and keep them in sync.

(module) 3.14 Sharing Types

  • Declaration files: generating them and writing them by hand
  • How TypeScript finds a package's types (types, exports)
  • isolatedDeclarations
  • and 2 more lessons

project: Emit declaration files, set up exports, and write a compatibility policy.

(module) 3.15 Type-Checker Performance

  • How the checker spends its time: instantiation, caching, and depth limits
  • Measuring with --extendedDiagnostics and --generateTrace
  • Faster patterns: interfaces over intersections, annotated return types, smaller unions
  • Performance budgets in CI

project: Measure the toolkit's type-check cost and fix its slowest type.

(module) 3.16 Large Codebases

  • Project references and monorepos
  • Incremental adoption: moving a loose codebase to strict, file by file
  • Measuring type coverage and tracking any
  • Codemods: changing thousands of files safely

project: Turn the repo into a monorepo with project references for the core and plugins.

(module) 3.17 Leading TypeScript in a Team

  • A shared tsconfig.json strategy
  • Type-safety lint rules worth enforcing
  • Review standards and an any budget
  • Upgrading TypeScript across a codebase: the 6.0 to 7.0 move as a case study

project: Write the toolkit's contributor guide: shared config, lint rules, and a review checklist.

(module) 3.18 Final Project

  • Option A: publish the toolkit with type tests, declaration files, and a compatibility policy
  • Option B: migrate a real open-source project to strict TypeScript and write up the results

project: Choose your finale: publish the toolkit, or migrate an open-source project and publish a write-up.

BonusBonus modules2 modules

(module) Bonus A TypeScript in the Real World

  • In the browser: DOM types, the lib setting, and why querySelector can return null
  • UI frameworks: what they are and why they exist. React as an example (typed props and state in a few lines), with Vue, Angular, and Svelte mentioned
  • On the server: Node.js, Deno, and Bun; a typed request handler
  • and 12 more lessons

project: Put TaskKit on GitHub, add a linter, and run your checks in CI.

(module) Bonus B Must-Have Libraries

  • How to use this catalog, and the questions to ask before adding any dependency
  • Valibot: a smaller, modular alternative to Zod
  • Immer: immutable updates written like ordinary changes
  • and 26 more lessons

project: Pick one library from the catalog and add it to the project of the level you're on.

// how the course is built

What makes it different

tsc --watch principles.ts

// Tested with TypeScript 7.x · Node.js LTS

  1. The language comes firstThe levels teach TypeScript and the JavaScript underneath it. Each level closes with a few popular, general-purpose libraries matched to its difficulty. Frameworks, tools, and the wider library catalog live in two separate bonus modules.
  2. Written for true beginnersLevel 1 assumes no programming knowledge. Every term is explained the first time it appears, with an everyday example.
  3. See it, then code itEvery lesson has at least one diagram or animation that shows the idea before the code does. Each module has one signature visual.
  4. Two tools, two jobsFrom the first lesson you run code with Node and check it with TypeScript, so you always see what the types catch for you.
  5. A project step in every moduleEach level grows one project, and every module adds a piece of it: a task manager, then a typed API client, then a type-safe library.
  6. Practice and stay currentPredict the type, fix the error, write the code, read someone else's code. Exercises are checked automatically, and every lesson shows the versions it was tested with.

// one value left to type: you

Turn the chaos into types

People with no programming experience. Nothing is assumed. Level 1, TypeScript Foundations, is free: 15 modules, 45‑60 hours.

51 modules · 89 lessons available now · 148 more coming · 155‑200 hours across 3 levels · Tested with TypeScript 7.x · Node.js LTS