Course 05 · Core

TypeScript
JavaScript, with the mistakes found first.

Types that describe what your code already does — and a compiler that reads them before anyone else has to.

14Lessons
≈ 3hReading
14Playable now
TypesUnionsGenericsUtility typesNarrowingPractice

0 of 14 lessons finished — nothing yet

The syllabus

14 lessons,
in the order they build on each other.

Start lesson one ↗
01

Why types

What a type checker is, what it is not, and the one idea the rest depends on.

≈ 10 min
02

Running it

tsc, tsconfig, strict, and the difference between compiling and checking.

≈ 10 min
03

The basic types

Annotations, inference, literal types, and the difference between any and unknown.

≈ 11 min
04

Object types

interface and type, optional and readonly fields, index signatures, excess properties.

≈ 12 min
05

Unions and narrowing

One value, several shapes — and how the compiler follows your if statements.

≈ 13 min
06

Functions

Parameters, returns, optional arguments, overloads, and what void really means.

≈ 12 min
07

Generics

A type that is decided by the caller, with constraints that keep it honest.

≈ 13 min
08

Arrays, tuples and as const

readonly arrays, fixed-length tuples, and freezing a literal into a type.

≈ 11 min
09

Utility types

Partial, Pick, Omit, Record, keyof and typeof — types derived from what you already have.

≈ 12 min
10

Type guards

typeof, instanceof, in, predicates and assertion functions — proving a type at runtime.

≈ 12 min
11

Classes and interfaces

Fields, access modifiers, implements, abstract — and when a plain object is better.

≈ 11 min
12

Modules and declarations

Importing types, declaration files, and giving an untyped package a shape.

≈ 11 min
13

The DOM and events

Typing what comes back from the page, and casting only where you have earned it.

≈ 12 min
14

TypeScript in practice

Strictness worth turning on, migrating JavaScript, and the line between types and runtime.

≈ 13 min