Function - Overloaded Function (Overloaded)


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


Function / Method

declare function getWidget(n: number): Widget;
declare function getWidget(s: string): Widget[];


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.

Documentation / Reference

Powered by ComboStrap