答案解析
const getSum = (...args1) => (...args2) => args1.concat(args2).reduce((a, b) => a + b, 0);
const result = getSum(1, 2, 3)(4, 5, 6);
=====================等于下面的操作
function getSum (...args1){
return function (...args2){
return args1.concat(args2).reduce((a, b) => a + b, 0);
}
}
var r = getSum(1,2,3)(4,5,6);
console.log(r);