Answers for "Selecting from Many Options with Switch Statements"

0

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);
Posted by: Guest on December-16-2020

Code answers related to "Selecting from Many Options with Switch Statements"

Code answers related to "Javascript"

Browse Popular Code Answers by Language