Adding a default option in Switch statements challenge [SOLVED]

So i’m stumped I know it has something to do with the letter as when it’s passed an “a” in the test the output is blank not even the default.

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

  switch (val){
      case("a"):
      answer="apple";
      break;
  
      case("b"):
      answer="brid";
      break;
  
      case("c"):
      answer="cat";
      break;

  default:
  answer="stuff";
  
  // Only change code above this line  
  return answer;  
}}

// Change this value to test
switchOfStuff("a");

Have you tried the syntax case ‘a’: instead of case(‘a’):?

Move your return statement out of the switch block.

1 Like

yea someone in chat pointed it out then i facepalmed but thanks you for the quick reply