mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
patched up array comprehensions somewhat. Parens are still a necessary evil, and there's still probably plenty of edge cases
This commit is contained in:
@@ -109,9 +109,9 @@ change_a_and_set_b: =>
|
||||
b: 20
|
||||
|
||||
# Array comprehensions.
|
||||
supper: food.capitalize() for food in ['toast', 'cheese', 'wine'].
|
||||
supper: [food.capitalize() for food in ['toast', 'cheese', 'wine']]
|
||||
|
||||
drink(bottle) for bottle, i in ['soda', 'wine', 'lemonade'] if even(i).
|
||||
[drink(bottle) for bottle, i in ['soda', 'wine', 'lemonade'] if even(i)]
|
||||
|
||||
# Switch statements ("else" serves as a default).
|
||||
switch day
|
||||
|
||||
Reference in New Issue
Block a user