Possible bug with "Test answer" button

Tell us what’s happening:
Describe your issue in detail here.
code works, possible malfuction?

  **Your code so far**
function caseInSwitch(val) {
let answer = "";
// Only change code below this line
switch ("2") {
case "1":
  console.log("alpha");
  break; 
case "2":
  console.log("beta");
  break;
case "3":
  console.log("gamma");
  break;
case "4":
  console.log("delta");
    
}

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

caseInSwitch(1);
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.63 Safari/537.36 Edg/102.0.1245.39

Challenge: Selecting from Many Options with Switch Statements

Link to the challenge:

HI @MrChuky !

Welcome to the forum!

You have a few issues here.

No1.:
You supposed to test val here.
This is incorrect

NO.2:

The issue is that all of your case studies are strings.
But you are supposed to be testing for numbers.

No.3:
The directions say to set the answer variable to the conditions of alpha, beta, etc.
Right now you are just logging them to the console which is incorrect.

Once you fix those things, then it will pass

1 Like

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