Basic JavaScript - Multiple Identical Options in Switch Statements

Tell us what’s happening:
Describe your issue in detail here.
What is wrong with this code, I’ve watched the video, did what the instructor did, but still, the code is still showing error. I need help on this.
Your code so far

function sequentialSizes(val) {
  let answer = "";
switch (val) {
  case 1:
  case 2:
  case 3:
    result = "Low";
    break;
  case 4:
  case 5:
  case 6:
    result = "Mid";
    break;
  case 7:
  case 8:
  case 9:
    result = "High";
    break;
}
  return answer;
  }
  // Only change code above this line
console.log(sequentialSizes(2));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.203

Challenge: Basic JavaScript - Multiple Identical Options in Switch Statements

Link to the challenge:

You have declared the variable named ‘answer’, and you use the variable named ‘result’ in the switch statement. This is all the same variable. Decide which name you will use.

1 Like