Twelve concepts
Twelve lessons with runnable exercises, from type aliases to recursive conditional types. Start at the beginning or pick a concept to practise.

0 of 12 exercises completed
Continue learning: Type aliasesExercise progress is saved on this device.
- 01
Type aliases
A name for a type. Everything else here is an alias that takes arguments.
Read the lesson - 02
Generic parameters
Aliases take arguments. `extends` in this position is a constraint, not inheritance.
Read the lesson - 03
keyof and indexed access
`keyof T` is the union of T’s keys; `T[K]` reads a property type back out.
Read the lesson - 04
Mapped types
Build an object by iterating a union of keys: `{ [K in Keys]: Value }`.
Read the lessonPracticed in#212 Rebuild Pick#219 Rebuild Partial#226 Rebuild Readonly#235 PickByType#236 Getters#241 Rebuild Required#242 Merge#246 Entries#247 Omit by type#249 Optional, but only these#256 Invert#257 Tuple to object#258 Which keys are optional
- 05
Modifiers
Add or strip `readonly` and `?` while mapping, with `+` and `-`.
Read the lessonPracticed in#212 Rebuild Pick#219 Rebuild Partial#226 Rebuild Readonly#235 PickByType#236 Getters#241 Rebuild Required#242 Merge#246 Entries#247 Omit by type#249 Optional, but only these#256 Invert#257 Tuple to object#258 Which keys are optional
- 06
Conditional types
`A extends B ? X : Y` — the type-level `if`, asking about assignability.
Read the lessonPracticed in#220 Rebuild Exclude#230 Permutation#238 UnionToIntersection#248 Is it never?
- 07
infer
Bind a type variable inside a pattern and use it in the true branch.
Read the lessonPracticed in#213 Unwrap#221 Return Type
- 08
Distributivity
A naked type parameter in a conditional distributes over unions. `[T]` stops it.
Read the lessonPracticed in#220 Rebuild Exclude#230 Permutation#238 UnionToIntersection#248 Is it never?
- 09
Template literal types
String patterns at the type level. Combined with `infer`, they parse.
Read the lessonPracticed in#214 Route Params#217 Split#224 Join#225 Trim#228 Replace#231 CamelCase#233 StartsWith#243 Absolute#244 Repeat#252 Query string#253 Snake case
- 10
Recursion
A conditional type that calls itself. The false branch is the exit.
Read the lessonPracticed in#215 Deep Readonly#222 Reverse#227 Includes#229 Flatten#237 Unique#240 Filter#245 Paths#251 Optional all the way down#259 Get by path
- 11
Variadic tuples
Spread tuples into tuples. `length` turns them into a counter.
Read the lessonPracticed in#216 Type-level Add#218 Last#223 Type-level Subtract#232 Zip#234 TupleToUnion#239 Chunk#250 Fill#254 Without#255 First
- 12

