3 ms·
TypeScript has support for union types and generics because they aren't interchangeable. The purpose of generics is to avoid having to duplicate code or list ev
by styfle 9y ago
TypeScript has support for union types and generics because they aren't interchangeable. The purpose of generics is to avoid having to duplicate code or list every possible type as an input.