Basic JavaScript - Chaining If Else Statements

Não consigo entender porque esta dando o erro de referência para o parâmetro num!

Alguém para explicar os acontece?

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

testSize(7);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Chaining If Else Statements

Link to the challenge:

This is your problem.

if (condition1) {
  statement1
} else if (condition2) {
  statement2
} else if (condition3) {
  statement3
. . .
} else {
  statementN
}

In what way is the example else different from yours?

Also:

if(nun < 5){

I think you meant num, right?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.