var fn = function (a, b, c) {
//console.log(a, b, c)
return a + b + c
};
function curryIt(fn) {
var k = []
var kk = fn
return function a(arg1) {
//console.log(...arguments)
for (let i = 0; i < arguments.length; i++) {
k.push(arguments[i])
}
//console.log(k)
return function b(arg1) {
//console.log(...arguments)
for (let i = 0; i < arguments.length; i++) {
k.push(arguments[i])
}
//console.log(k)
return function c(arg1) {
for (let i = 0; i < arguments.length; i++) {
k.push(arguments[i])
}
//console.log(k)
return fn(...k)
}
}
}
}
console.log(curryIt(fn)(1)(2)(3));
//console.log(curryIt().length)
console