1. If/else Unexpected token else


#1

I keep getting "SyntaxError: Unexpected token else". Here's my code:

var isEven = function(number) {
  if (isEven % 2 === 0); {
      return true;
  } else {
      return false;
  };
};
isEven(4);

#2

Hi @free.spirit,

Please see this reference on semicolons and the article linked here on conditionals and then ask yourself whether you're closing your if prematurely. ( --> Unexpected...else) :slight_smile: