Function - Overloaded Function (Overloaded)

> Code - (Programming|Computer) Language > (Function | Operator | Map | Mapping | Transformation | Method | Rule | Task | Subroutine)

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

Advertising

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.

4 - Documentation / Reference