Confused on the IF/ELSE IF/ ELSE?


#1

Not sure whats wrong with my code… Keeps saying i have a syntax error yet been looking at it for the past 30 minutes haha probably just a dumb mistake! Thanks


var isEven = function(number) {
  if (number % 2 === 0); {
     return(1);
  }
   else if (isNaN(number)) {
       return ("This is not a number silly!")
   
   } else {
     return(0);
  }
  
}; 
isEven();




#2

You have a semicolon after your first if statement, it’s terminating the line early
everything else looks good though


#3

Thanks so much! just a dumb mistake haha


#4

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