We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function curry(fn) { return function curries(...args) { if (args.length >= fn.length) { return fn.apply(this, args); } else { return function (...args2) { return curries.apply(this, [...args, ...args2]) } } } } // 示例 const sum = (a, b, c) => { return a + b + c; } const cy = curry(sum); console.log(cy(1, 2, 3)); // 6 console.log(cy(1, 2)(3)); // 6 console.log(cy(1)(2, 3)); // 6 console.log(cy(1)(2)(3)); // 6
以**cy(1)(2)(3)**为示例简单描述下代码的执行过程:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
以**cy(1)(2)(3)**为示例简单描述下代码的执行过程:
The text was updated successfully, but these errors were encountered: