Last active
February 28, 2018 10:12
-
-
Save juliomatcom/661d9823af6c3ae94ef0ae50207e5b51 to your computer and use it in GitHub Desktop.
curry implementation
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
function curry(f) { | |
return function currify() { | |
const args = Array.prototype.slice.call(arguments); | |
return args.length >= f.length ? | |
f.apply(null, args) : | |
currify.bind(null, ...args) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment