What is spread, default and rest parameters in JavaScript ?
The default, spread, and rest parameters were added in ES6. Default Parameter: It is used to give the default values to the arguments, if no parameter is provided in the function call. Syntax: function fnName(param1 = defaultValue1, ..., paramN = defaultValueN) { ... } Example 1: In the below exampl