i am new to currying but i have a problem that i can't solve.
function curry(func) {
return date1=>{
return date2=>{
return date3=>{
return func(date1,date2,date3);
};
};
};
}
function format_date(a,b,c){
return a+ "." + b +"."+c;
}
var date= curry(format_date);
console.log(date(1)(12)(2020));
console.log(date(1,12)(2020));
console.log(date(1)(12, 2020));
console.log(date(1,12, 2020));
the output of all logs should be
1.12.2020
but i only get the first right other return [Function(anonymous)]