Function
A function produces a return value from a list of argument values.
Related concepts: OperatorArgumentReturnMethod
Closest Wikipedia entry: Subroutine — In computer programming, a function or subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed. Functions may be defined within programs, or separately in libraries that can be used by many programs.
Misconceptions about Function15 documented Misconceptions
Check YourselfArrowFunctionNoImpliedReturn
Even when an arrow function consists just of an expression, the return keyword must be explicitly writtenArrowFunctionRequiresFunctionKeyword
Arrow functions also require the keyword 'function'CallbackParametersInCaller
Parameters of a callback function may be written as parameters of the caller functionFunctionAsValueWithParentheses
To use a function as a value, one needs to have parentheses after its nameFunctionOverloading
It is possible to create multiple functions with the same name but with different signaturesFunctionsCannotBeImmediatelyInvoked
Functions cannot be called in the expression in which they are definedFunctionsMustBeNamed
Every function definition requires an associated nameNoFunctionCallsChaining
It is not allowed to chain function callsNumberOfParametersMatchArguments
Functions must be called with the same number of arguments as defined in their signature