FunctionDeclaration: ( Modified ) BindingIdentifieropt CallSignature {
FunctionBody function
BindingIdentifieropt CallSignature
Function declarations that specify a body are called function implementations and function declarations without a body are called function overloads. It is possible to specify multiple overloads for the same function (i.e. for the same name in the same declaration space), but a function can have at most one implementation. All declarations for the same function must specify the same set of modifiers (i.e. the same combination of declare
, , and default
).
When a function has both overloads and an implementation, the overloads must precede the implementation and all of the declarations must be consecutive with no intervening grammatical elements.