mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
[docs] examples of using guards and indices in array comprehensions
This commit is contained in:
parent
0b57b3136c
commit
98cc7eb149
1 changed files with 8 additions and 0 deletions
|
@ -1,2 +1,10 @@
|
|||
# Eat lunch.
|
||||
eat food for food in ['toast', 'cheese', 'wine']
|
||||
|
||||
# Fine dining
|
||||
courses = ['salad', 'entree', 'dessert']
|
||||
menu course + 1, dish for dish, course in courses
|
||||
|
||||
# Health conscious meal
|
||||
foods = ['broccoli', 'spinach', 'chocolate']
|
||||
eat food for food in foods when food isnt 'chocolate'
|
||||
|
|
Loading…
Add table
Reference in a new issue