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

I noticed that while reading it as well, as it's one of the (few) things that bugs me when writing coffeescript. It should have a 'then' between the conditions of each 'for' loop and 'do', because that is the only way to include the loop body (the 'do' statement) on the same line as the loop conditions.

   do (methods = ['remove', 'show', 'hide', 'stop']) ->
      for method in methods then do ->
        Frame.prototype[method] = ->
          for element in elements then do ->
            this[element][method]()


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

Search: