Content deleted Content added
→Methods: Improved formatting for better rendering. Tags: Mobile edit Mobile web edit |
→Functions: Improved formatting for better rendering on mobile version. Tags: Mobile edit Mobile web edit |
||
Line 1,145:
==Functions==
A [[function (programming)|function]] is a block with a (possibly empty) parameter list that is normally given a name. A function may use local variables. If you exit the function without a return statement, the value
<syntaxhighlight lang=JavaScript>
Line 1,162:
Functions are [[first class object]]s and may be assigned to other variables.
The number of arguments given when calling a function may not necessarily correspond to the number of arguments in the function definition; a named argument in the definition that does not have a matching argument in the call will have the value
<syntaxhighlight lang=JavaScript>
|