jashkenas--coffeescript/documentation/examples/switch_with_no_expression.c...

9 lines
160 B
CoffeeScript

score = 76
grade = switch
when score < 60 then 'F'
when score < 70 then 'D'
when score < 80 then 'C'
when score < 90 then 'B'
else 'A'
# grade == 'C'