Else/if with isNaN


#1


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


Oops, try again. Make sure your if/else if/else statement returns a string when the function input isn't a number.


var isEven = function(number) {
  if(number % 2 === 0){
    return(true);
  }
  else if(isNaN = false){
      return("What you put in isn't a number");
  }
  else{
      return(false)
  }
};


#2

And what is isNaN

How you should work with isNaN can you read here:
Method isNaN()


#3

remove the brackets in return, and remember to put what you want to check in the isNaN(something)


#4

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