3 ms·
So if you don't want any static typing, don't use TypeScript. But if you are adopting TypeScript to retrofit some kind of static typing onto your code, and if y
by asolove 14y ago
So if you don't want any static typing, don't use TypeScript. But if you are adopting TypeScript to retrofit some kind of static typing onto your code, and if you use any kind of functional programming helpers (map, reduce, filter, etc.) then generics are basically a necessity.
Otherwise you have two options: define separate methods for mapArrayOfNumbers, mapArrayOfStrings, etc. or have a lot of casts to the ground type and write a lot of code that isn't actually statically typed.