标签:style java io for ar cti javascript new
function curry(fn){
var slice = Array.prototype.slice;
var arr = slice.call(arguments,1);
return function(){
var newArr = slice.call(arguments);
var args = newArr.concat(arr);
return fn.apply(null,args);
}
}
function add(){
var icur = 0;
for(var i=0; i <arguments.length; i++){
icur += arguments[i],10;
}
return icur;
}
var number = curry(add,1)(2,3,4,5,6,7,8,9,10);
console.log(number); //55
标签:style java io for ar cti javascript new
原文地址:http://www.cnblogs.com/fengzekun/p/3892101.html