If Else If Else (isNaN)



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;


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

see comment


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