Not allowing me to pass through EVEN with pasted answer from help tutorial

I am copying and pasting the code from the help video and this task still won’t complete.

Also, the hints this and the golf challenge give are totally different to the solution provided in the help videos.

  **case 1:
  answer = "alpha";
  break;
case 2:
  answer = "beta";
  break;
case 3:
  answer = "gamma";
  break;
case 4:
  answer = "delta";
  break;

}

return answer;
}**


function caseInSwitch(val) {
let answer = "";
// Only change code below this line
  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
return answer;
}

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

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

Challenge: Selecting from Many Options with Switch Statements

Link to the challenge:

You have not wrapped your switch case conditionals inside a switch statement
Proper Syntax for Switch case is:

switch(expression) {
case "anything":
//do something;
break;
}

Provide your existing switch conditional with a switch expression

Hint Below. Recommended to try thinking it out first!!

switch(val) {
your code here
}

Thanks! I’ll delete this question now…

Generally we don’t delete posts. Someone may benefit from reading the question in the future and there is zero shame in learning something by asking questions. That’s how we learn.

1 Like