jeudi 3 décembre 2020

Practicing javascript and stuck on error in if statement

i am practicing javascript again after 3 months of gap and now im unable to find where im wrong in below code when i just copy and paste same code from my history it runs perfectly but this one says "SyntaxError: unknown: Unexpected token (18:0)" Can anybody highlight my mistake???

    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 {
      return "Huge";
    
  // Only change code above this line
}

testSize(7);

Aucun commentaire:

Enregistrer un commentaire