function curry(fn, ...args) { if (args.length >= fn.length) { return fn(...args); } else { return curry.bind(null, fn, ...args); } }