Function - Overloaded Function (Overloaded)
Table of Contents
1 - About
Same function name but with a different signature (list of parameters)
Their will be then the same function name or an operator but that manipulates two different objects (data structure, type).
2 - Articles Related
3 - Example
3.1 - Function / Method
declare function getWidget(n: number): Widget;
declare function getWidget(s: string): Widget[];
3.2 - Operator
built-in operators such as addition (+), can be:
- integer addition
- or floating-point addition.
The two operations work on different types of operands and require different functions.