forked from opinsys/example-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
CoffeeScript
epeli edited this page Jan 12, 2012
·
11 revisions
- Variables
- Safety closure
- Functions
- implicit return, calling with objects, calling with multiple callbacks
- No coercion issues
isis alway=== - Loops,
while,for v in arr,for k, v of ob,for own k, v of ob - Binding function aka Fat arrow
=> - Everything is an expression
numbers = for i in [0..10]
i * 2- Classes and prototypes
- Works well with plain Javascript
- Existential Operator
foo?.bar - Destructing Assignment
{Foo} = require "bar",[host, port] = getConfig - List Comprehensions
(i for i in [0..100] when i > 50) -
and,or,is,isnt,notinstead of===,&&,||etc. - Multiline strings. Regexp too.
- String interpolation.
"I have #{ variable }" - Array slicing
numbers[numbers.length/2...numbers.length]