Bug in FreeCodeCamp

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

  **Your code so far**

function chainToSwitch(val) {
var answer = "";
// Only change code below this line

  switch(val) {
  case "bob":
    answer = "Marley";
  case 42:
    answer = "The Answer";
  case 1:
    answer = "There is no #1";
  case 99:
    answer = "Missed me by this much!";
  case 7:
    answer = "Ate nine";
    answer = "";

// Only change code above this line
return answer;

  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36

Challenge: Replacing If Else Chains with Switch

Link to the challenge:

The console in freeCodeCamp.org says that the above code is wrong. However, when I run in in VS Code, it runs perfectly. What’s up?

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

Not bug, typo.
Error message: “chainToSwitch(7) should be the string Ate Nine”
you have “Ate nine”

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