Function Arguments
Arguments are the actual values in a call. Rest parameters collect extra arguments into an array.
Where to run this
This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.
A practical example
function sum(...values) {
return values.reduce((total, value) => total + value, 0);
}
console.log(sum(2, 3, 4));
What happens
The total is 9.