CoffeeScript
Last updated
Last updated
more coffeescript tricks:
loop array: for item in arr
or for item, index in arr
loop object: for prop, value of obj
or for own property, value of object
(use hasOwnProperty())
read
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.
coffeescript reverse for loop: for i in [arr.length-1..0] by -1