Created
October 2, 2018 13:40
-
-
Save ryanlaws/6e7d12ab370f0079357954c9e8a352c1 to your computer and use it in GitHub Desktop.
Partial function application
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 partial = (f) => | |
(...args) => | |
(args.length >= f.length) | |
? f(...args) | |
: partial(f).bind(this, ...args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment