js function object spread parameter code example
Example 1: the rest operator javascript
function sum(...numbers) {
return numbers.reduce((accumulator, current) => {
return accumulator += current;
});
};
sum(1,2) // 3
sum(1,2,3,4,5) // 15
Example 2: spread operator javascript
[a, b, ...objIteravel] = [1, 2, 3, 4, 5];