// Tell us what’s happening:
//This passes the test in freeCodecamp course but I get an error for the case if I enter a //number. ie. switchOfStuff(3);
//Your code so far
function switchOfStuff(val) {
var answer = "";
// Only change code below this line
switch(val){
case "a" || 1:
return "apple";
break;
case "b" || 2:
return "bird";
break;
case "c" || 3:
return "cat";
break;
default:
return "stuff";
break;
}
// Only change code above this line
return answer;
}
// Change this value to test
switchOfStuff(2);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/adding-a-default-option-in-switch-statements