I have a real issue with this lesson as how much emphasis was placed on strict conditionals and yet to solve the challenge you don’t use them at all.
I was thinking I had to write something like this:
function caseInSwitch(val) {
var answer = "";
// Only change code below this line
switch caseInSwitch(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;
}
There are two problems here. For one, there are syntax errors that will cause the code to fail. Also, I had no way of knowing that I shouldn’t call the function caseInSwitch() inside my switch statement, instead switch(val) is the correct syntax.
If strict conditionals are important, where would they go?
On a side note, this challenge drove me a little crazy because of how little instruction you are given about switch statements before expecting to create your own.