What's wrong with this isEven function?


#1

My code looks like this but fails when submitted:

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

};
isEven("woord");

#2

What are you doing on this line;

if (!(number % 2))

i would rewrite, and compare the remainder to zero to see if the number is even or odd.