Operator odpoczynku (... Args)
function sum(...args) {
let total = 0;
for (const a of args) {
total += a;
}
return total;
}
sum(1, 2, 3);Code language: JavaScript (javascript)
Handsome Abhishek