10 lessons · 106 min Intermediate

TypeScript — types that frame your code and the AI

The bug JavaScript lets through, the compiler catches before execution. 10 lessons building on your JS basics, with a real TypeScript compiler in the browser.

FR EN
Progress 0/10
1

Why TypeScript?

The bug JavaScript never sees, TypeScript underlines in red before anything runs. The compiler becomes your reviewer — and the AI's.

9 min
2

Types and inference

string, number, boolean… and inference: TypeScript guesses most types by itself. Annotate little, but well.

10 min
3

Interfaces and type aliases

Describe the shape of your objects: interface or type, optional properties, readonly — and typos caught dead.

10 min
4

Unions and narrowing

A value that can be two things: string | number. Narrowing shrinks the uncertainty down to a safe type.

11 min
5

Well-typed functions

Parameters, returns, optionals, callbacks: a function's full contract — no more calls with a missing argument.

10 min
6

Generics

The cake mold: reusable code that keeps the type contract. The course's pivot lesson, taken gently.

12 min
7

Utility types

Partial, Pick, Omit, Record: transform existing types instead of rewriting them.

10 min
8

Compile time vs runtime

Types are erased at runtime: what tsconfig compiles, what "as" promises, and why an API can still lie to you.

10 min
9

Installing TypeScript

npm install, tsconfig (strict by default), and the pro workflow: who runs your code, who checks your types. From zero to a fully tooled project.

12 min
10

TS in the real world

any piercing the net vs unknown forcing checks, the DOM, API responses — and the TS + AI workflow.

12 min

What you will learn

Read and write types: inference, interfaces, unions, narrowing — annotate little, but well

Tame generics (the cake mold) and utility types (Partial, Pick, Omit…)

Understand what TypeScript guarantees (compile time) and what it does NOT (runtime, any, lying casts)

Use types as a contract to frame AI-generated code — and spot its fake fixes (as any)

Prerequisites: being comfortable in JavaScript (the JavaScript course, ideally Advanced JavaScript). Every lesson embeds a real TypeScript compiler in the browser: you see type errors live, with nothing to install.

Start lesson 1

Free · No signup · 9 minutes