1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
jashkenas--coffeescript/test/fixtures/execution/test_switch.coffee

32 lines
379 B
CoffeeScript
Raw Normal View History

num: 10
result: switch num
2009-12-28 23:08:02 -05:00
when 5 then false
when 'a'
true
true
false
when 10 then true
# Mid-switch comment with whitespace
# and multi line
2009-12-28 23:08:02 -05:00
when 11 then false
else false
print(result)
func: num =>
switch num
when 2, 4, 6
true
when 1, 3, 5
false
else false
print(func(2))
print(func(6))
print(!func(3))
print(!func(8))