标签:参数 har current ret exp return sum sha func
function(...args){ }
111
function sum(...theArgs) {
return theArgs.reduce((previous, current) => {
return previous + current;
});
}
console.log(sum(1, 2, 3));
// expected output: 6
console.log(sum(1, 2, 3, 4));
// expected output: 10
标签:参数 har current ret exp return sum sha func
原文地址:https://www.cnblogs.com/wayhome123/p/13382986.html