Basic JavaScript - Adding a Default Option in Switch Statements

I dont know why my code isnt working and it doesnt even shows me where the mistake is, i just watched in a forum that i need to add the word answer before every word but that wasnt stated on the lesson but it still doesnt work

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;
default:
answer="stuff";



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

switchOfStuff(1);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Adding a Default Option in Switch Statements

Link to the challenge:

You forgot the switch keyword. Look closely at the example in the instructions. What is the first line?

1 Like

thanks a lot I was getting so frustated.