If/else problem



I can't find out what is wrong with my code. Every time I send it the error "SyntaxError: expected expression, got keyword 'else'" shows up. What can I do?

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


if (number%2===0);  // here remove ;

and after closing else statement call the function.


It worked! Thank you!


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