function switchOfStuff(val) {
var answer = "";
// Only change code below this line
switch (num) {
case "a":
answer = "apple";
break;
case "b":
answer = "bird";
break;
case "c":
answer = "cat";
break;
case "d":
answer = "stuff";
break;
}
default:
answer = "stuff";
break;
return answer;
// Only change code above this line
return answer;
}
console.log(switchOfStuff("a"));
What is the variable num? You are switching on it, but it doesn’t exist in your code anywhere.
The default case is outside the switch statement, which is a syntax error (it also doesn’t need a break because it’s the default case; there’s nothing to break from at that point, but that’s minor and won’t affect anything).