TS Course · 63 lessons · approx. 422 minutes

Learn TypeScript

TypeScript adds types to JavaScript. Errors are noticed before the code runs – and your editor understands your code much better.

  • Types & compiler
  • Inference
  • Object types
  • Interfaces
  • Union types
  • Generics
  • Zod
  • Your own programs & going deeper
  • Generics: a type as a placeholder
  • readonly: data for reading only
  • Discriminated union: two result shapes
  • Record: values under fixed keys
  • keyof: valid property names
  • Tuples: two values with a fixed role
  • unknown: check first, then use
  • Optional properties with ?
  • Function types: a calculation as a parameter
  • Partial: changing only some properties
  • Type guards with “is”
  • as const: fixed values as a type
  • Typing named values with Record
  • Offering a list as unchangeable
  • Describing fixed positions with a tuple
  • Shrinking a data model with Pick
  • Telling results apart by a discriminator
  • A generic function keeps element types
  • Narrowing unknown data before using it
  • Checking a shape with satisfies
  • Union & intersection types
  • Utility types
  • TypeScript + JSON: processing data safely

What you’ll learn

  1. Chapter 1Why TypeScript? – Types and the compiler.
    Types & compiler
  2. Chapter 2Primitive types & inference – string, number, boolean – and when TS thinks along by itself.
    Primitive types
  3. Chapter 3Arrays, tuples & object types – Types for lists and structures.
    Typing arrays & functions
  4. Chapter 4type & interface – Defining your own object types.
    Interfaces
  5. Chapter 5Your code workshop – Connect what you have learned and discover a new building block.
    Several allowed types
  6. Chapter 6Workshop: understand and build it yourself – Practise new building blocks with short explanations and your own programs.
    Union: one of several types · Narrowing: limiting the type · Boss: a typed learning progress
  7. Chapter 7New tools for your own ideas – Understand new concepts, fill them in and use them yourself.
    Generics: a type as a placeholder · readonly: data for reading only · Discriminated union: two result shapes
  8. Chapter 8Level up: your next practice chapter – Understand four new building blocks in small steps and use them yourself.
    Record: values under fixed keys · keyof: valid property names · Tuples: two values with a fixed role · unknown: check first, then use
  9. Chapter 9Master chapter: how real programs are built – Five building blocks from real projects – explained, connected, filled in and written by you.
    Optional properties with ? · Function types: a calculation as a parameter · Partial: changing only some properties · Type guards with “is” · as const: fixed values as a type
  10. Chapter 10Project tools: understand and apply – Eight more building blocks with explanation pages and four exercises per lesson.
    Typing named values with Record · Offering a list as unchangeable · Describing fixed positions with a tuple · Shrinking a data model with Pick · Telling results apart by a discriminator · A generic function keeps element types · Narrowing unknown data before using it · Checking a shape with satisfies
  11. Chapter 11Union & intersection types – Defining allowed values, combining types and telling them apart safely.
    Literal types: only allowed values · Intersection: combining types with & · Telling apart with in · never: checked completely · Boss: processing order status safely
  12. Chapter 12Generics – Blueprints with placeholders: interfaces, functions and classes for many types.
    Generic interfaces: Box<T> · Constraints with extends · Reading safely with K extends keyof T · Generic classes: a stack · Boss: a generic store
  13. Chapter 13Narrowing & type guards – Narrowing types down deliberately.
    typeof: text or number? · Array.isArray: one or many? · instanceof: handling errors safely · Missing values: ruling out undefined · Boss: evaluating every input safely
  14. Chapter 14Utility types – Ready-made type tools: Omit, Required, Readonly, ReturnType and combinations.
    Omit: leaving out properties · Required: everything has to be there · Readonly<T>: read only · ReturnType: taking over the result type · Boss: types for a course API
  15. Chapter 15Async & API types – Typing promises and data from APIs.
    Promise<T>: what comes back later? · Types for API responses · Promise.all with types · A result type instead of exceptions · Boss: a typed loader
  16. Chapter 16tsconfig & strict mode – Configuring projects properly.
    strict: the strict mode · noImplicitAny: every parameter needs a type · find can return undefined · The exclamation mark ! – only for a good reason · Boss: making code fit for strict
  17. Chapter 17TypeScript + JSON: processing data safely – JSON arrives from the web as text, TypeScript gives it shape: interfaces, unknown with type guards, response variants and evaluations.
    JSON gets a type: interface · Check first, then trust: unknown and type guards · Responses with variants: union with a tag · Summarising data: Record · Boss: evaluating an API response

Final project: Typed task manager

A small task manager with clean types and validation.

How it works

Every lesson starts with short explanation pages. Then you practise with multiple-choice questions, fill-in-the-gap tasks, putting code in order and writing your own code – with hints and instant feedback. Free, without ads, on phone, tablet and PC.

Learn TypeScript now