1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
jashkenas--coffeescript/documentation/examples/array_comprehensions.coffee

11 lines
315 B
CoffeeScript
Raw Normal View History

2009-12-21 11:41:45 -05:00
# Eat lunch.
eat food for food in ['toast', 'cheese', 'wine']
2011-12-18 13:41:33 -05:00
# Fine five course dining.
courses = ['greens', 'caviar', 'truffles', 'roast', 'cake']
menu i + 1, dish for dish, i in courses
2011-12-18 13:41:33 -05:00
# Health conscious meal.
foods = ['broccoli', 'spinach', 'chocolate']
eat food for food in foods when food isnt 'chocolate'