News for hackers. Stuff that matters.
Re:Currying in JavaScript by serve_yay on Monday July 20, 2015 @01:31AM (#9914158)
ES6 rest/spread operator is really nice for dealing with function arguments.

    function curry(fn) {
      return function accum(...args) {
         if(args.length >= fn.length) {
           return fn.apply(null, args)
         }
    
         return accum.bind(null, ...args)
      }
    }

There are no comments on this comment yet.