Selecting from Many Options with Switch Statements help

Tell us what’s happening:
stucked

Your code so far


function caseInSwitch(val) {
  var answer = "val";
  // Only change code below this line
 
 switch (val) {
  case "1":
 return  "alpha";

  case "2":
  return "beta";
  
  case "3":
return "gamma";
 
  case "4":
 return "delta";
 }

  
  
  // Only change code above this line  
  return answer;  
}

// Change this value to test
caseInSwitch(1);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/selecting-from-many-options-with-switch-statements

Looks like you are on the right track! You’re missing two things I see from here, the data type for each case is a string and there is one more thing. Might want to see another switch case example to update the problem

https://guide.freecodecamp.org/javascript/switch-statements/

1 Like