Created
September 20, 2018 02:49
-
-
Save Sawtaytoes/92fc442c20c571ca0e42c4982800d4aa to your computer and use it in GitHub Desktop.
Dynamic currying function written for functional code (no `this` context).
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
curry = func => (...args) => ( | |
args.length >= func.length | |
? func(...args) | |
: (...moreArgs) => curry(func)(...args.concat(moreArgs)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment