After solving this challenge, I must say it is very poorly explained. I didn’t understood that the phrase after “case” !IS! the strict equation and it takes as an argument, the value of val.
Could you please re-write this challenge to be more understandable?
Your code so far
function caseInSwitch(val) {
var answer = "";
// Only change code below this line
switch (val) {
case 1:
answer = "alpha";
break;
case 2:
answer = "beta";
break;
case 3:
answer = "gamma";
break;
case 4:
answer = "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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/selecting-from-many-options-with-switch-statements