function sum(){
var _args = Array.prototype.slice.call(arguments)
var add = function(){
_args.push(...arguments)
return add
}
add.valueof = function(){
return _args.reduce((a,b)=>{
return a+b
})
}
return add
}
console.log(sum(1,2)(3).valueof())
10-22
493
03-31
1018
10-12
1100
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交