jashkenas--coffeescript/documentation/coffee/array_comprehensions.coffee

5 lines
150 B
CoffeeScript
Raw Normal View History

2009-12-21 16:41:45 +00:00
# Eat lunch.
lunch: this.eat(food) for food in ['toast', 'cheese', 'wine']
2009-12-21 16:41:45 +00:00
# Zebra-stripe a table.
2009-12-30 05:22:27 +00:00
highlight(row) for row, i in table when i % 2 is 0