Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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);


And remember that 'bind' can save your life

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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: