SHARE
TWEET

Untitled

a guest Sep 19th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function curry(fn) {
  2.   return function curried() {
  3.     const args = Array.prototype.slice.call(arguments)
  4.     const done = args.length >= fn.length
  5.     if (done) {
  6.       return fn.apply(this, args)
  7.     } else {
  8.       return function() {
  9.         const args2 = Array.prototype.slice.call(arguments)
  10.         return curried.apply(this, args.concat(args2))
  11.       }
  12.     }
  13.   }
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top