Skip to content

Instantly share code, notes, and snippets.

@SpencerAung
Last active January 28, 2020 07:28
Show Gist options
  • Save SpencerAung/079d3d1c37e0d90bad30e60c15c410a4 to your computer and use it in GitHub Desktop.
Save SpencerAung/079d3d1c37e0d90bad30e60c15c410a4 to your computer and use it in GitHub Desktop.
Curry function implementation in ES2015
function curry(fn) {
return (...args) => {
if (args.length >= fn.length) {
return fn(...args)
}
return curry(fn.bind(null,...args))
}
}
export default curry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment