Rest Parameters
Rest Parameters — Rest parameters allow a function to accept an indefinite number of arguments as an array, using the `...` syntax. Rest parameters collect all remaining arguments into a single array. They replace the older `arguments` object with a proper array that has full array methods. Rest parameters must be the last formal parameter. They are particularly useful for variadic functions, function composition, and array manipulation. This term relates to the Function category of the reference. You will meet rest parameters in practice when working with APIs such as Function.prototype.call(), Function.prototype.apply(), Function.prototype.bind(), Function.prototype.toString(). Related terms: Closure, Hoisting, Event Loop, Prototype Chain, Temporal Dead Zone (TDZ), IIFE (Immediately Invoked Function Expression). Understanding rest parameters makes the rest of the JavaScript documentation noticeably easier to follow, because the concept recurs across methods, guides, and error messages. Look up more definitions in the JavaScript glossary.