I need a little help with this , I keep getting error

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

  **Your code so far**

function switchOfStuff(val) {
let answer = "";
// Only change code below this line
case "a":
answer = "apple";
break;
case "b":
answer = "bird";
break;
case "c";
answer = "cat";
break;


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

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

User Agent is: Mozilla/5.0 (Linux; Android 9; Infinix X650B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.88 Mobile Safari/537.36

Challenge: Adding a Default Option in Switch Statements

Link to the challenge:

The example you are given for a switch statement is this:

switch (num) {
  case value1:
    statement1;
    break;
  case value2:
    statement2;
    break;
...
  default:
    defaultStatement;
    break;
}

Is that what yours looks like?

Oh i forgot to put the switch statement.
Thanks kindly

Oh i forgot to put the switch statement.
Thanks kevinSmith

Yeah, that’s a big part of it. You also have a typo and are missing the default.

What typo ? And where exactly

You used a semicolon in a spot that should be a colon. Use your detective skills, read the console, figure it out. Debugging is one of the most important skills for a developer.

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