3 ms·
> please tell me if I'm wrong There's no exact equivalent, but you can use generic functions or function overloads to achieve something similar: https://www.t
by Tade0 4y ago
> please tell me if I'm wrong
There's no exact equivalent, but you can use generic functions or function overloads to achieve something similar:
https://www.typescriptlang.org/docs/handbook/2/functions.html#generic-functions https://www.typescriptlang.org/docs/handbook/2/functions.htm...
Of course it won't select an implementation for you, so you'll have to handle all the possible type combinations yourself in the function body.
- staticassertion 4y agoYeah, that's pretty different. That's still the programmer having to think about types as a separate entity or a runtime construct.