leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
2632.js (254B)
0 /**
1 * @param {Function} fn
2 * @return {Function}
3 */
5 var curry = function(fn) {
6 return function curried(...args) {
7 if(args.length >= fn.length)
8 return fn(...args);
9 return (...nextArgs) => curried(...args, ...nextArgs);
10 };
11 };