It keeps telling me I’m not meeting the following guidelines:
caseInSwitch(1)
should have a value of “alpha”
caseInSwitch(2)
should have a value of “beta”
caseInSwitch(3)
should have a value of “gamma”
caseInSwitch(4)
should have a value of “delta”
…but I am!
Why won’t it let me pass the challenge?
My code so far
function caseInSwitch(val) {
var answer = "";
// Only change code below this line
switch(val) {
case 1:
console.log("alpha");
break;
case 2:
console.log("beta");
break;
case 3:
console.log("gamma");
break;
case 4:
console.log("delta");
break;
}
// Only change code above this line
return answer;
}
caseInSwitch(1);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36
.
Challenge: Selecting from Many Options with Switch Statements
Link to the challenge: