switch statements free code camp code example
Example: Selecting from Many Options with Switch Statements
function caseInSwitch(val) {
var answer = "";
switch(val){
case 1:
answer = "alpha"
break;
case 2:
answer = "beta"
break;
case 3:
answer = "gamma"
break;
case 4:
answer = "delta"
break;
}
return answer;
}
caseInSwitch(1);