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.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.
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.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.