How to define isNan


#1

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

Oops, try again. It looks like you have an error in your code! See the error message for more details: ReferenceError: isNan is not defined


var isEven = function(number) {
  
  if(number%2 === 0){
      return "true";
  }
  else if(isNan() ){
      return "I understand";
  }
  else{
      return "false";
  }

};
isEven();


#2

isNan should be structured like this (isNaN(number)) - Capitalisation is important.

You are also supposed to return Boolean values true and false rather than the strings true and false. But you are right when you return a string for the isNaN else if.


#3

thanks alot for the help!


#4

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