News for hackers. Stuff that matters.
Re:Fixing the callback spaghetti in node.js by voidr on Thursday September 29, 2011 @03:03AM (#3051456)
You don't have to use inline functions all the time, you can do it like this:

  function foo () {.... }
  function bar () {....foo(); }
  function barfoo () {....bar(); }

  doSomething(barfoo);
Re:Fixing the callback spaghetti in node.js by jigs_up on Thursday September 29, 2011 @04:02PM (#3054025)
And remember that 'bind' can save your life

this.io.sockets.on('connection', this.onConnection.bind(this));