Functions - JavaScript | MDN - MDN Web Docs
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions
OverviewDefining functionsCalling functionsFunction scopeScope and the function stackClosuresUsing the arguments objectFunction parametersArrow functionsDefault parametersIn JavaScript, parameters of functions default to undefined. However, in some situations it might be useful to set a different default value. This is exactly what default parameters do.
In the past, the general strategy for setting defaults was to test parameter values in the body of the function …Rest parametersThe rest parameter syntax allows us to represent an indefinite number of arguments as an array.
In the following example, the function multiply uses rest parameters to collect arguments from the second one to the end. The function then multiplies these by the first argument.See more on developer.mozilla.org
DA: 33 PA: 73 MOZ Rank: 2