I have a few different buttons that are calling the same function and I would like to have them wrapped in a switch statement instead of using a bunch of else if conditions. Any
In addition to the details in the accepted answer, switch statements in CoffeeScript also supports , to provide multiple match results:
switch
,
switch someVar when val3, val4 then ... else ...
or (if your statements has multiple lines):
switch someVar when val3, val4 ... else ...