Last active
September 14, 2018 15:17
-
-
Save chee/6d34d54d5aa2f3463c5b2730e7c8e89f to your computer and use it in GitHub Desktop.
curry
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
| l='length';c=f=>function c(...a){return a[l]>=f[l]?f(...a):(...n)=>c(...a,...n)} |
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 => function c(...args) { | |
| return args.length >= fn.length ? fn(...args) : (...next) => c(...args, ...next) | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
c=f=>function c(...a){return a[l='length']>=f[l]?f(...a):(...n)=>c(...a,...n)}