Please Help: Multiple Identical Options in Switch Statements

Please Help: Multiple Identical Options in Switch Statements
0

#1

Hello, can you help me to fix 193 challenge?

function myTest(val) {
var answer = “”;
// Only change code below this line
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;
}

// Only change code above this line
return answer;
}

// Change this value to test
myTest(1);


#2

Your code seems to be fine. What do you need to fix?


#3

Hi,

You seem to have changed the function name. You have called it myTest, but it should be sequentialSizes.


#4

The solution is:

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”;

}

// Only change code above this line
return answer;
}

// Change this value to test
sequentialSizes(1);


#5

the example says
result = “1, 2, or 3”;

but for this problem solution, i replaced those lines with
return"Low";

*this also works for the “return” line
answer=“Low”;


#6

I may be far off this post ( date wise), but using variable answer in place of the return key for the statments worked:

answer = “Low”;
answer = “Mid”;
answer = “High”;