Why isn't this working? What's wrong?

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
}

// Change this value to test
console.log(testSize(20));

Challenge: Chaining If Else Statements

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/chaining-if-else-statements

1 Like

else doesnt need a condition.

1 Like