//未柯里化
function add(a,b){
return a + b;
}
//柯里化
function add(y){
return function(x){
console.log(y + "+" + x + "=");
return y + x;
}
}
add(2)(1);//1+2 = 3
//未柯里化
function add(a,b){
return a + b;
}
//柯里化
function add(y){
return function(x){
console.log(y + "+" + x + "=");
return y + x;
}
}
add(2)(1);//1+2 = 3
转载于:https://www.cnblogs.com/johnnyzen/p/7887558.html