//将传入的参数转为数组
const turnArray = (...rest)=> [].slice.apply(rest);
//利用reduce对数组求和
const add = arr => arr.reduce((pre,cur)=>pre+cur);
console.log(add(turnArray(1,2,3,4,5,6)));
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)