Nick is certainly correct in his answer as one of the possible solutions. However, for me, a cleaner approach might look like this:
var species = '#species#';
switch(species){
case "cat":
case "dog":
case "zebra":
}
Using this approach, you prevent the server and client code from intertwining in the same way, which leads to more readable code.
source
share