Where is the syntax error for this when I'm trying to use isNaN?


#1

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

It gave me a syntax error, but I can't tell what I did wrong. Thank you in advance for any help.

var isEven = function(number) {
  // Your code goes here!
 if (number % 2 === 0) {
     return true;
     } else if (isNaN(number) {
         console.log("The input is not a valid number.");
         } else {
         return false;
         }; 
};

isEven('Kevin');


#2

else if (isNaN(number)

missed a ) bracket


#3

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