Coffeescript reading notes

Written by Keith McDonnell. Last updated on Thursday, July 07, 2011.

= Asciicast 267

Like js but without punctuation & passing function keyword littered all over the place.

Whitespace sensitive

loop construct: for i in []

has ruby like ranges

inline if then else

no explicit return needed

Javascript: $(function() {
Coffeescript: jQuery →

replace references to this with @, eg this.value becomes @value

If you'd like to discuss this article, you can send me an email and/or publish an article online and link back to this page.