📅  最后修改于: 2022-03-11 15:02:32.150000             🧑  作者: Mango
function sum(...theArgs) {
return theArgs.reduce((previous, current) => {
return previous + current;
});
}
console.log(sum(1, 2, 3));
// expected output: 6