Level 2 of TypeScript from Zero

Practical TypeScript

Everyday power of the type system

modules
18
lessons
76
hours
55‑70

Paid · coming soon

This level

What Level 2 gives you

Who it's for
Level 1 graduates, or people who already program a little. A placement quiz tells you where to start.
You'll be able to
Use the full everyday power of the type system, model a domain with types, protect code from bad data, and review TypeScript critically.
Running 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.

Lessons take 20 to 30 minutes, some shorter or longer as the topic needs. Each module ends with a one-page cheat sheet, in its last lesson. Levels 2 and 3 start with a placement quiz, and a glossary covers the whole course.

Modules

18 modules, 76 lessons

M1 · 4 lessonsTypeScript's Own Tools
  1. 1.1tsc: --noEmit, --watch, and reading its output
  2. 1.2Your editor as a TypeScript tool: hover, go to definition, rename, quick fixes
  3. 1.3Reading long, nested type errors
  4. 1.4Strict flags beyond strict: what each one catches and which to turn on
  5. Project stepStart the API client: strict flags, plus check and watch scripts.
M2 · 5 lessonsHarder Narrowing Cases
  1. 2.1Exhaustiveness checking with never
  2. 2.2Type guards (x is T), and when TypeScript infers them for you
  3. 2.3Assertion functions (asserts x is T)
  4. 2.4instanceof and class-based narrowing
  5. 2.5Type assertions (as): when they're justified and why they're risky
  6. Project stepModel the client's commands as a union and handle every case exhaustively.
M3 · 9 lessonsType Operators
  1. 3.1Intersection types (&): combining shapes, and how they differ from extends
  2. 3.2The wide types: unknown, object, and {}
  3. 3.3keyof
  4. 3.4The typeof type operator
  5. 3.5Indexed access types (T["key"])
  6. 3.6as const and types derived from data
  7. 3.7The satisfies operator
  8. 3.8Index signatures and noUncheckedIndexedAccess
  9. 3.9Why Object.keys returns string[]
  10. Project stepDerive command names and option types from one as const config checked with satisfies.
M4 · 4 lessonsGenerics in Practice
  1. 4.1Constraints with extends
  2. 4.2The K extends keyof T pattern
  3. 4.3Default type parameters
  4. 4.4Generic classes and containers
  5. Project stepWrite a generic request<T>() helper and a typed cache Cache<K, V>.
M5 · 4 lessonsBuilt-in Utility Types
  1. 5.1Partial, Required, Readonly; a missing property vs undefined
  2. 5.2Pick, Omit, Record
  3. 5.3Exclude, Extract, NonNullable
  4. 5.4ReturnType, Parameters, Awaited
  5. Project stepBuild create, update, and summary types from one base type.
M6 · 3 lessonsImmutability and Tuples
  1. 6.1readonly arrays and ReadonlyArray<T>
  2. 6.2Named, optional, and rest elements in tuples
  3. 6.3Updating without mutating: toSorted, with, and structuredClone
  4. Project stepMake settings and cache entries read-only; return new objects instead of changing old ones.
M7 · 5 lessonsDesigning with Types
  1. 7.1Making impossible states impossible
  2. 7.2Modeling loading, success, and error states
  3. 7.3Branded types for IDs and units
  4. 7.4Parse, don't validate
  5. 7.5When not to add more types
  6. Project stepModel each request as idle, loading, success, or error, and brand the IDs.
M8 · 4 lessonsAdvanced Functions
  1. 8.1Function overloads
  2. 8.2Typing this, and how methods lose their context
  3. 8.3Generic callbacks and higher-order functions
  4. 8.4Iterables and generators: function* and Generator<T>
  5. Project stepAdd an overloaded get() and a generator that pages through results.
M9 · 4 lessonsClasses in Depth
  1. 9.1implements and abstract
  2. 9.2Getters, setters, and static members
  3. 9.3protected, and why modern code avoids parameter properties
  4. 9.4Composition vs inheritance
  5. Project stepHide HTTP behind an interface with two classes: a real client and a fake one.
M10 · 5 lessonsErrors and Concurrent Code
  1. 10.1Custom error classes and cause
  2. 10.2The Result pattern instead of exceptions
  3. 10.3Promise.all, allSettled, race, any, and their types
  4. 10.4Timeouts and cancellation with AbortController
  5. 10.5Async iteration with for await
  6. Project stepReturn Results instead of throwing; add timeouts, cancellation, and parallel requests.
M11 · 5 lessonsData at App Boundaries
  1. 11.1Why types don't protect you at runtime
  2. 11.2Writing validators by hand with type guards
  3. 11.3Typing and validating API responses
  4. 11.4Deriving types from validators: the idea behind schema libraries
  5. 11.5Typing and validating configuration and environment variables
  6. Project stepValidate every API response with hand-written guards before it enters the app.
M12 · 4 lessonsStandard Library Essentials
  1. 12.1Regular expressions: the basics, and typed match results
  2. 12.2Intl: formatting numbers, currencies, and dates for any language
  3. 12.3Dates and times: Date pitfalls and Temporal
  4. 12.4The rarer primitives: bigint and symbol
  5. Project stepFormat prices, dates, and numbers for the user's locale; parse fields with regex.
M13 · 5 lessonsHow TypeScript Finds and Runs Code
  1. 13.1tsconfig.json in detail: target, module, rootDir, outDir, lib, types
  2. 13.2Module resolution: nodenext or bundler, and how to choose
  3. 13.3ESM and CommonJS: what you'll meet in other people's code
  4. 13.4Three ways to run TypeScript, and when to use each
  5. 13.5Organizing a project: folders, barrel files, and a module's public API
  6. Project stepReorganize the client into folders with a clear public API and build it with tsc.
M14 · 4 lessonsUntyped Code
  1. 14.1Libraries without types: declare module
  2. 14.2Ambient declarations, global types, and .d.ts files
  3. 14.3Namespaces: recognizing an older pattern
  4. 14.4OptionalIf you end up in a JavaScript project: allowJs, checkJs, and JSDoc
  5. Project stepAdd a small untyped helper package and describe it with your own .d.ts file.
M15 · 3 lessonsReviewing TypeScript Code
  1. 15.1Type-safety smells: any, as, !, @ts-ignore, and a switch that isn't exhaustive
  2. 15.2Reading unfamiliar TypeScript
  3. 15.3Reviewing AI-generated TypeScript with the same checklist
  4. Project stepReview your own client with the smell checklist and fix what you find.
M16 · 3 lessonsTesting Typed Code
  1. 16.1Structuring tests with node:test; typed fixtures and test data builders
  2. 16.2Testing asynchronous code
  3. 16.3Typed test doubles without a framework
  4. Project stepCover the client with tests, using the fake HTTP class from Module 9.
M17 · 4 lessonsPopular Libraries, Step Two
  1. 17.1zod: schemas that become types, compared with your hand-written validators
  2. 17.2axios: typed HTTP requests, and why get<User>() is a promise, not a check
  3. 17.3ts-pattern: exhaustive pattern matching over unions
  4. 17.4vitest: moving your node:test suite to a popular test framework
  5. Project stepReplace hand-written guards with Zod, try axios, and move the tests to Vitest.
M18 · 1 lessonFinal Project
  1. 18.1A typed command-line API client: validated responses (by hand, then with Zod), a disk cache, Result-based errors, and full tests
  2. Project stepShip the client: a README, a clean check run, and tests for every core feature.

Visual language

The pictures this level teaches with

Your certificate

What you earn when you finish Level 2

Read every lesson of the level and it is yours, with your name on it. Pass every exercise and quiz as well, and it says Theory and Practice.

DevFox LabsNo. SAMP · LE
Theory

Certificate of completion

Your
Name

has read every lesson of

TypeScript from Zero: Level 2 · Practical TypeScript

Lessons read76 / 76
Issued27 November 2026

Levels

Take this level, or the whole course

Complete course

TypeScript from Zero · Complete

Every level, from your first line of code on.

Paid · in progress
  • Level 1 · TypeScript Foundationsincluded, free
  • Level 2 · Practical TypeScript
  • Level 3 · Advanced TypeScript
  • 51 modules · 237 lessons
  • + Bonus · 2 modules, free
  • 155‑200 hours
Start with Level 1
Level 2

Practical TypeScript

Everyday power of the type system

Paid · coming soonExpected$99 · Q2 2027
  • 18 modules · 76 lessons
  • 55‑70 hours
  • Project: Typed API client

Use the full everyday power of the type system, model a domain with types, protect code from bad data, and review TypeScript critically.

See every lesson
Bonus

2 bonus modules · 44 lessons

Free
Open Bonus Modules

Not part of the levels. These two modules show where TypeScript is used and which libraries you'll meet. Each lesson explains what a platform, tool, or library is for and shows one short example of where TypeScript helps. The tools themselves are learned separately; this course doesn't teach them in depth.

  • Bonus A · 15 lessonsTypeScript in the Real WorldPart 1 reads best after Level 2. Its Git lesson, the first of Part 2, builds on Level 1's lessons 15.2 and 15.3: read it any time after Level 1.
  • Bonus B · 29 lessons · coming soonMust-Have LibrariesA catalog, not a sequence: read any lesson once you've reached the level on its tag. Libraries already taught inside the levels (chalk, commander, date-fns, lodash, zod, axios, ts-pattern, vitest, type-fest, Drizzle or Kysely, tRPC) aren't repeated here.
Curriculum v6 · September 2026Tested with TypeScript 7.x · Node.js LTS
    Practical TypeScript — Level 2 of TypeScript from Zero | DevFox Labs