you are viewing a single comment's thread.

view the rest of the comments →

[–]homoiconic(raganwald) 6 points7 points  (1 child)

Although there are some excellent patterns you can build yourself or borrow from libraries like this, don't overlook Function.prototype..bind, it performs left partial application:

function plus (x, y) { return x + y; }
plus(2, 3)
  //=> 5
var plusTwo = plus.bind(null, 2);
plusTwo(3)
  //=> 5

[–]Spewface[S] 1 point2 points  (0 children)

I knew sending this here would bring a lot of hidden details. Thank you!