CoffeeScript
more coffeescript tricks: https://gist.github.com/dfurber/993584
iterate
loop array:
for item in arr
orfor item, index in arr
loop object:
for prop, value of obj
orfor own property, value of object
(use hasOwnProperty())
fat arrow in coffeescript
read this
use => when we need @ to be the object in which method is written; use-> when we need @ to be the object in which method is executed.
String with format
Instance method, variables
How to write function as a part of parameter
reverse for loop
coffeescript reverse for loop: for i in [arr.length-1..0] by -1
iterations in coffeescript
Last updated