2. else/if else/ else


#1

Stuck, any help would be greatly appreciated, thanks!

Oops, try again. It looks like you have a ReferenceError! Maybe you deleted isEven?

ReferenceError: isNan is not defined
true

var isEven = function(number) {

  if (number % 2 === 0) {
      return true
  }
  else if(isNan(number)) {
      return "This is not a number you fool!"
  }  
  else {
      return false
  }
};
isEven(prompt("Type a number"));

#2

Change isNan to isNaN

See the difference?

Capitalisation is imporant here.


#3

Wow, thanks i combed over that for a while and somehow kept missing it.


#4

It took me a while to figure out :sweat_smile:

It's always the little things that catch us out :wink:


#5

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