-
Notifications
You must be signed in to change notification settings - Fork 0
CoffeeScript
CoffeeScript.org has tons of examples of CoffeeScript code side-by-side with its corresponding JavaScript (so you can see how much code you'll save).
CoffeeScript compiles to JavaScript, so it's important to understand the good and bad parts of JavaScript when working with CoffeeScript. See our JavaScript guide.
CoffeeScript resolves some of the bad parts of JavaScript. For example, CoffeeScript adds var
to variable names when compiling to JavaScript, so you don't need to worry about accidental global variables. (Use window.SomeNamespace = { ... }
to define a global variable namespace in web browsers.) Also, ==
and !=
in CoffeeScript compile to ===
and !==
in JavaScript, so you don't have to worry about that. See more details in the Little Book of CoffeeScript, below.
To dive deeper into how to use classes, comprehensions, and other concepts, read the quick Little Book of CoffeeScript.