1
JavaScriptIntermediate#objects
Both use ... — spread expands an iterable or object into individual elements, while rest collects remaining items into an array or object. Spread appears where values are consumed, rest where they are declared.
const merged = { ...a, ...b }; // spread
const arr = [...a, 4]; // spread
function sum(...nums) { // rest
return nums.reduce((s,n)=>s+n,0);
}