TSTypeScript

Learn TypeScript – all lessons

15 lessons from beginner to advanced, building on each other and with code examples.

Beginner
1

Hello TypeScript & Compiling

Your first program and what the compiler does.

2

Basic Types & Type Inference

string, number, boolean, arrays, tuples, any and unknown.

3

Typing Functions

Parameters, return types, optional arguments and function types.

4

Objects, Interfaces & Type Aliases

Describing the shape of objects – optional, read-only and extensible.

5

Union & Literal Types

Restricting values to several types or fixed values.

Intermediate
6

Narrowing, Type Guards & Discriminated Unions

Narrowing types in code and letting the compiler check all cases.

7

Generics

Reusable functions and classes that work with many types.

8

Classes in TypeScript

Access modifiers, parameter properties, abstract and implements.

9

Utility Types

Partial, Pick, Omit, Record & co. – deriving types from types.

10

Strict Mode & Null Safety

Why strict: true is a must and how to handle null and unknown safely.

11

Modules, Type Declarations & tsconfig

import type, @types packages, .d.ts files and important compiler options.

Advanced
12

keyof, typeof & Mapped Types

Computing types from values and from other types.

13

Conditional Types, infer & Template Literals

Types with "if-then" logic and strings at the type level.

14

Advanced Patterns: satisfies, Brands & Overloads

Proven techniques for safe and expressive APIs.

15

Async, APIs & Runtime Validation

Promise<T>, typed fetch functions and why types do not check data.