Variable and Parameter
Keyword | Scope | IsMutable |
---|---|---|
| function | yes |
| block | yes |
| block | no |
Destructuring
Destructuring Arrays
Destructuring Objects
default parameters
Rest Parameter (is like varargs)
Rest parameter allows the functions to accept an indefinite number of arguments as as array.
Rest parameter should appear after any regular parameters.
Spread Parameter
Spread parameter is the exact opposite of how Rest parameter works.
It allows a function to take an array as as argument and then spread out its elements so that they can be assigned to individual parameters.
Template Literals
JavaScript always hoists the declaration of any variable at the top so even if in code it appears to be after calling the variable it won't give an error.
Last updated