TypeScript 25 🔷 Generics — Functions
Generics let you write functions that work with many types while preserving the type relationship between input and output. Instead of function identity(x: any): any, you write function identity<T>(x: T): T — and TypeScript understands that whatever you pass in comes back out with the same type. Generics are the mechanism behind Array<T>, Promise<T>, Map<K,…