News for hackers. Stuff that matters.
Re:Learning Advanced JavaScript by diN0bot on Monday November 16, 2009 @02:45PM (#945126)
ok, but once you start using closures everywhere someone has the bright idea to abstract most of that code into a utility function. before you know it, you're back to bind.

  function _bind(o, m) {
    var bound_arguments = Array.prototype.slice.apply(arguments, [2]);
    return function() {
      var now_arguments = Array.prototype.slice.apply(arguments);
      var args = bound_arguments.slice().concat(now_arguments);
      return m.apply(o, args);
    }
  }
Re:Learning Advanced JavaScript by bumblebird on Monday November 16, 2009 @03:14PM (#945194)
Abstracting out "function(c){return function(){/stuff/}}(this)" seems like overkill to me.

I guess it's a matter of taste etc.