I, newbie, don’t know why my code doesn’t work…! please help!

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

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

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

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Safari/605.1.15

Challenge: Selecting from Many Options with Switch Statements

Link to the challenge:

Hey there! Welcome to the forums :wave: :slightly_smiling_face:

What seems to be the issue? Any error messages? Something you don’t understand? The more info you give us the better we can help.


Count your opening curly brackets, {, and compare them to your closing, }, it looks like you might be missing one :wink:

2 Likes

Thank you! I figured out that I didn’t close the curly bracket but idk for some reason I can’t run the code.

well, syntax errors stop the code from running

1 Like

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