const curry = (fn, ...args) => {
if (args.length >= fn.length) {
return fn(...args);
} else {
return (..._args) => curry(fn, ...args, ..._args);
}
};
const curry = (fn, ...args) => {
if (args.length >= fn.length) {
return fn(...args);
} else {
return (..._args) => curry(fn, ...args, ..._args);
}
};
本文标题:手写源码-柯里化
本文链接:https://www.haomeiwen.com/subject/jtskpltx.html
网友评论