Hello. I am trying to understand why the switch() function requires a variable. How is var answer linked to switch(val). Thank you
function sequentialSizes(val) {
var answer = "";
// Only change code below this line
switch(val) {
case 1:
case 2:
case 3:
return 'Low';
break;
case 4:
case 5:
case 6:
return 'Mid'
break;
case 7:
case 8:
case 9:
return 'High'
break;
}
// Only change code above this line
return answer;
}
// Change this value to test
sequentialSizes(1);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/multiple-identical-options-in-switch-statements/