Created
September 8, 2019 18:40
-
-
Save pfftdammitchris/9af3563890753ae64d481a88cff6a994 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const curry = (fn) => { | |
return function curried(...args) { | |
const done = args.length >= fn.length | |
if (done) { | |
return fn.apply(this, args) | |
} else { | |
return (...args2) => curried.apply(this, [...args, ...args2]) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment