JavaScript Spread_rest Guide
The spread (...) and rest (...) operators handle arrays, objects, and function parameters with concise syntax. The guide walks through Spread Operator, Rest Parameters. Array spread: `[...arr1, ...arr2]`, `Math.max(...nums)`. Object spread: `{...obj1, ...obj2}` (shallow merge). Copy: `const copy = [...arr]`, `const copy = {...obj}`. String to array: `[...str]`. Function call: `fn(...args)`. Spread creates shallow copies — nested objects are still referenced. Function rest: `function(a, b, ...rest) { }` — captures remaining args as array. Destructure: `const [first, ...rest] = arr`, `const {a, ...rest} = obj`. Must be last parameter. Replaces `arguments` object in modern JS. Array rest collects remaining elements. Object rest collects remaining own enumerable keys. The guide is organized into 2 sections that build on each other, each pairing a prose explanation with runnable code. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page.