isNaN is killing me


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(number)) {
return "Not a number";
} else {
      return false;


Passes on my end. Maybe you did something with the environment that breaks your function or the submission test. Refresh page.

However, you should probably check if the value is a number before treating it like a number.


Well then, I have no idea what the problem was... but refreshing the page worked. Thanks!!


A post was split to a new topic: What is wrong with this?


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