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

This is how I do setTimeout:

  delay = (ms, func) -> setTimeout func, ms
So you can write it like this:

  delay 100, -> console.log "100 ms passed"


The problem is it isn't the only situation this comes up in, and the fact that this has to be done at all is a testament to the problems with adding significant whitespace to a language not completely designed for it.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

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

Search: