mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
Docs: Define functions used in loop examples (#4653)
* Cherrypick changes from messy branch * Reorder function defs
This commit is contained in:
parent
aef54aeaf7
commit
4623bf5bba
1 changed files with 2 additions and 0 deletions
|
|
@ -1,8 +1,10 @@
|
|||
# Eat lunch.
|
||||
eat = (food) -> "#{food} eaten."
|
||||
eat food for food in ['toast', 'cheese', 'wine']
|
||||
|
||||
# Fine five course dining.
|
||||
courses = ['greens', 'caviar', 'truffles', 'roast', 'cake']
|
||||
menu = (i, dish) -> "Menu Item #{i}: #{dish}"
|
||||
menu i + 1, dish for dish, i in courses
|
||||
|
||||
# Health conscious meal.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue