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


Your browser information:

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

Challenge: Basic JavaScript - Chaining If Else Statements

Link to the challenge:

This is your problem.

if (condition1) {
} else if (condition2) {
} else if (condition3) {
. . .
} else {

In what way is the example else different from yours?


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.