function reverse(x: number): number;function reverse(x: string): string;function reverse(x: number | string): number | string {if (typeof x === 'number') {return Number(x.toString().split('').reverse().join(''));} else if (typeof x === 'string') {return x.split('').reverse().join('');}}
https://stackoverflow.com/questions/12688275/is-there-a-way-to-do-method-overloading-in-typescript
