mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
changing array comprehension filters from 'where' to 'when' to mirror case/when
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
nums: n * n for n in [1, 2, 3] where n % 2 isnt 0
|
||||
nums: n * n for n in [1, 2, 3] when n % 2 isnt 0
|
||||
results: n * 2 for n in nums
|
||||
|
||||
# next: for n in [1, 2, 3] if n % 2 isnt 0
|
||||
|
||||
@@ -21,7 +21,7 @@ func: =>
|
||||
text = c.text
|
||||
}
|
||||
|
||||
c.list: l for l in d.text.split('') where l is '-'
|
||||
c.list: l for l in d.text.split('') when l is '-'
|
||||
|
||||
c.single: c.list[1..1][0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user