Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. const curry = (fn) => {
  2. return function curried(...args) {
  3. const done = args.length >= fn.length
  4. if (done) {
  5. return fn.apply(this, args)
  6. } else {
  7. return (...args2) => curried.apply(this, [...args, ...args2])
  8. }
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement