📅  最后修改于: 2022-03-11 14:55:04.038000             🧑  作者: Mango
function sum(...args) {
let total = 0;
for (const a of args) {
total += a;
}
return total;
}
sum(1, 2, 3);Code language: JavaScript (javascript)