const curry = fn => { return function curried (...args) { const that = this; if (args.length < fn.length) { return curried.bind.apply(curried, [that].concat(args)); } else { return fn.apply(that, args); } }; }; export default curry;