CoffeeScript is a programming language that compiles to JavaScript. It aims to enhance JavaScript with features like significant whitespace, variables and functions declarations, and pattern matching. The document provides an overview of CoffeeScript's syntax and features like classes, functions, objects, and array/object comprehensions which compile down to cleaner JavaScript code. Examples are given throughout to illustrate CoffeeScript code and its compiled JavaScript output.
2. Jeremy Ashkenas
JavaScript's less
ostentatious kid brother
one-to-one
with JavaScript
better
functional syntax
compiles to
the good parts
http://jashkenas.github.com/coffee-script/
2
3. if (typeof elvis !== "undefined" && elvis !== null) {
alert("I knew it!");
}
3
40. The Rest...
Everything is an expression; always a return value
Pattern matching with object literals
Switch/When/Else
While/Until/Loop
Try/Catch/Finally
Chained comparison
Multiline Strings, Heredocs, and Block Comments
"text/coffeescript" script tags with extras/coffee-script.js
Cake and Cakefiles
http://jashkenas.github.com/coffee-script/
22