Switch cases in Javascript

Tell us what’s happening:
Describe your issue in detail here.
there is an issue running this code. After parsing in all the values required the code is not “running”

  **Your code so far**

function caseInSwitch(val) {
let answer = "";
// Only change code below this line
switch(caseInSwitch){
case 1:
answer="alpha"
break;
case 2:
answer="beta"
break;
case 3:
answer="gamma"
break;
case 4:
answer="delta"
break;

}
return answer

// Only change code above this line

}

console.log(caseInSwitch(2));
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36

Challenge: Selecting from Many Options with Switch Statements

Link to the challenge:

There is an issue here. “caseInSwitch” is the name of the function. Is that the variable you want to test?

1 Like

figured, thank you. I appreciate it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.