I wasn’t paying attention to the requirements and just started typing. My code produced the correct results but skipped setting a value to the variable “answer”. Is this normal since the return value was correct or is it a bug in the problem.
Your code so far
function caseInSwitch(val) {
var answer = "";
// Only change code below this line
switch (val) {
case 1:
return "alpha";
break;
case 2:
return "beta";
break;
case 3:
return "gamma";
break;
case 4:
return "delta";
break;
}
// Only change code above this line
return answer;
}
// Change this value to test
caseInSwitch(1);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36.
Link to the challenge:
https://www.freecodecamp.org/challenges/selecting-from-many-options-with-switch-statements