Rest Parameters
Definition
The `...` syntax used in function parameters to collect all remaining arguments into an array. Unlike the `arguments` object, rest parameters produce a real array.
Code Example
Javascript
Tip: Modify the code above and click “Run” to see the results
Learn More
Related Terms
Destructuring
A syntax for extracting values from arrays or properties from objects into distinct variables. Destructuring simplifies code and is commonly used in function parameters, imports, and React hooks.
Spread OperatorThe ... syntax that expands an iterable (array, string, object) into individual elements. Used for copying arrays/objects, merging, and passing multiple arguments to functions.