2. else/if else/ else


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

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"));


Change isNan to isNaN

See the difference?

Capitalisation is imporant here.


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


It took me a while to figure out :sweat_smile:

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


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