We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
A way to capture any remaining arguments in a function call and pass them to an array.
function sum(...numbers) { let result = 0; for (let number of numbers) { result += number; } return result; } console.log(sum(1, 2, 3)); // Output: 6 console.log(sum(1, 2, 3, 4, 5)); // Output: 15
There was an error while loading. Please reload this page.