Tell us what’s happening:
The code is exactly the same as the example in the video but it doesn’t work. However, if I copy the code from the video and paste it then it works.
I don’t understand why this happens. This the code from the video:
function sequentialSizes(val) {
let answer = “”;
switch(val) {
case 1:
case 2:
case 3:
answer = “Low”;
break;
case 4:
case 5:
case 6:
answer = “Mid”;
break;
case 7:
case 8:
case 9:
answer = “High”;
break;
}
return answer;
}
**Your code so far**
function sequentialSizes(val) {
let answer = "";
Switch(val) {
case 1:
case 2:
case 3:
answer = "Low";
break;
case 4:
case 5:
case 6:
answer = "Mid";
break;
case 7:
case 8:
case 9:
answer = "High";
break;
}
return answer;
}
console.log(sequentialSizes(1));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Challenge: Basic JavaScript - Multiple Identical Options in Switch Statements
Link to the challenge: