Please I need help here


#1

var isEven = function(number) {
// Your code goes here!

if(isNaN("number"))
{
return false;
}
else if(number % 2 === 0)
{
return true;
}
else
{
return false;
}
};

it says my function returns false for 2!

I don't get why.


#2
if(isNaN("number"))
  {    
      return false;
  }

you need to use number here instead of "number". "number" is a string so it is obviously Not a Number and therefor false is always chosen even if 2 should print out true. Also shouldn't you output a string in case of isNaN?


#3

Thanks very much.@haxor789