Understanding Function Overloading in TypeScript
Too Long; Didn't Read
In TypeScript, we can specify a function that can be called in different ways by writing function overloading signatures. To get **overload signatures**, we should write two function signatures: one accepting a string type, and another accepting argument with an array of numbers type. Overload 1 of 2, '(s: string): number', gave the following error error: 'Hello' is not assignable to type 'number' Type 'number[]' is 'not assignable' to type'string.