Skip to content

Instantly share code, notes, and snippets.

@pfftdammitchris
Created September 8, 2019 18:40
Show Gist options
  • Save pfftdammitchris/9af3563890753ae64d481a88cff6a994 to your computer and use it in GitHub Desktop.
Save pfftdammitchris/9af3563890753ae64d481a88cff6a994 to your computer and use it in GitHub Desktop.
const curry = (fn) => {
return function curried(...args) {
const done = args.length >= fn.length
if (done) {
return fn.apply(this, args)
} else {
return (...args2) => curried.apply(this, [...args, ...args2])
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment