If / else if / else


Part 2 [Thread Title]

SyntaxError: Unexpected token ILLEGAL

On the else if statement, IsNan should return a true value if a string were passed into the function. Since it is saying invalid token, I was unsure. Tried passing a string into the function with no luck. Not sure what is wrong.

var isEven = function(number) {
  if(number % 2 ==0){
    return true;
  else if(isNaN(number)){
      return "H'm, that's not a number!";
      return false;


Try refreshing the screen and submitting again. If that doesn't work, is it giving any other info in the error? Link what line it's on? It looks correct to me.


Hey, g. Tried it a little later; it works fine! :slight_smile:


call isEven function outside of your function


It worked fine without calling it. For the record, I did try that to no avail. It must have been a brief hiccup or something; it worked fine, though.

Thank you!


if you don't call the function you get no result...


Quick question: are we supposed to define isNan?


Thanks alot for the clarification