If/else problem


#1


https://www.codecademy.com/pt-BR/courses/javascript-beginner-pt-BR-teo7h/0/1?curriculum_id=5355c2d8516bcbd912000009#


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;
      }
};


#2

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

and after closing else statement call the function.


#3

It worked! Thank you!


#4

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