Why is the code telling me to put ";" before "{"

Tell us what’s happening:

Your code so far


function testSize(num) {
// Only change code below this line
if(num < 5){return "Tiny"}
else if (num < 10) {return "Small"}
else if(num < 15) {return "Medium"}
else if (num < 20) {return "Large"}
**else (num >= 20) {return "Huge"}**

return "Change Me"
// Only change code above this line
}

testSize(7);

Your browser information:

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

Challenge: Chaining If Else Statements

Link to the challenge:

the issue there is that you can’t give a condition to an else statement, as the else statement execute when none of the previous statements in the chain did

4 Likes