News for hackers. Stuff that matters.
Re: by joetyson on Monday March 07, 2011 @12:35AM (#2296160)
You can also create a 'bind' that returns a function that when called applies the context you desire.

  function bind(fn, selfObj) {
     return function() {
        return fn.apply(selfObj || window);
     };
  }

  callback = bind(function(){ alert(this.hello); }, this);

There are no comments on this comment yet.