Reporting a problem with the lesson: Selecting from Many Options with Switch Statements

Tell us what’s happening:
Whenever i run this thing
It tells me there is an error with case
Changing the code to the correct one doesn’t’work either
and now it refuses to even run the test.

No reply need.

Your code so far


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

// 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/80.0.3987.163 Safari/537.36.

Challenge: Selecting from Many Options with Switch Statements

Link to the challenge:

Changing the browser cleared the issue.

You have to have done something more than clearing your cache. The given code is very incorrect syntax.

Even changing the code onto: freeCodeCamp Challenge Guide: Selecting from Many Options with Switch Statements
would’t help and resolved into the same issue.
I did’t post that because I am not allowed to post the actually answer here.

I’m just pointing out that the code provided in your main post cannot even run so that the next person who searches the forum for help on this challenge does not mistakenly believe that the code you wrote is correct syntax.

2 Likes

People should’t go onto this forum looking for answers they should try and sollute it themself.

Conducting research on the forums is encouraged. Research is a critical step in problem solving.

To learn more about how to problem solve, read here: https://www.freecodecamp.org/news/read-search-dont-be-afraid-to-ask-743a23c411b4/

2 Likes