Skip to content

Commit 4623bf5

Browse files
bendrexlGeoffreyBooth
authored andcommitted
Docs: Define functions used in loop examples (jashkenas#4653)
* Cherrypick changes from messy branch * Reorder function defs
1 parent aef54ae commit 4623bf5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

documentation/examples/array_comprehensions.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Eat lunch.
2+
eat = (food) -> "#{food} eaten."
23
eat food for food in ['toast', 'cheese', 'wine']
34

45
# Fine five course dining.
56
courses = ['greens', 'caviar', 'truffles', 'roast', 'cake']
7+
menu = (i, dish) -> "Menu Item #{i}: #{dish}"
68
menu i + 1, dish for dish, i in courses
79

810
# Health conscious meal.

0 commit comments

Comments
 (0)