Type parameters, constraints, and inference — write reusable, type-safe code without sacrificing flexibility.
Five passes over the same idea, each from a different angle. Do them in order, or jump to whichever you need.
Generics let you create reusable components that work with multiple types while maintaining type safety. Key concepts: type parameters, constraints (extends), default types, generic functions, generic classes, and inference. Understanding generics is the gateway to advanced TypeScript.