Tell us what’s happening:
What I don’t understand is the example does not help a beginner understand how to answer the exercise.
Here is an example of a switch
statement:
switch(lowercaseLetter) {
case "a":
console.log("A");
break;
case "b":
console.log("B");
break;
}
why does it have console.log there but when I watched the help video he had answer = “alpha”;. Like how was I suppose to know to put that there when the example shows console.log. Also why does it have strings as case and console.log when its numbers for case. So confused this part of the tutorial.
Your code so far
function caseInSwitch(val) {
var answer = "";
// Only change code below this line
// Only change code above this line
return answer;
}
caseInSwitch(1);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36
.
Challenge: Selecting from Many Options with Switch Statements
Link to the challenge: