If Else If Else (isNaN)


#1


https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/2?curriculum_id=506324b3a7dffd00020bf661#


I'm not sure what's wrong with this code. On the line of "else" code error says "Expected an identifier but instead saw 'else'. Missing ';' before statement". Any help would be appreciated. Thanks!


var isEven = function(number) {
    if(number%2 === 0) {
      return true;
  } else if (isNaN(number)); {
      return "The function is not a number!";
  } else {
      return false;
}
};
isEven("apple");


#2

else if (isNaN(number)); // unnecessary semi-colon

see comment


#3

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