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

A nice example on Node. Only I don't quote get the ',' syntax. Is it a scoping thing?


It's a Coffee syntax thing.

  ws.on 'close', -> ps.kill()
That compiles to:

  ws.on('close', function() {
    return ps.kill();
  });


I have never done any Coffee but it looks like arguments are separated by commas, and, in this case, the second argument is a function of no argument (so the left hand side of the arrow is empty).

Edit: it was meant to be a reply to the parent.




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

Search: