Problem with syntax


#1


Hello Everybody.
After minutes of trying i still don´t find out what´s wrong with the following syntax:


var isEven = function(number) {
// Your code goes here!
if number (%2===0){
return true;
}
else {
return false;
}
};


https://www.codecademy.com/courses/javascript-beginner-en-qDwp0/0/1?curriculum_id=506324b3a7dffd00020bf661#

Following Error-Messages:

Oops, try again. There was a problem with your syntax.
SyntaxError: Unexpected identifier


Replace this line with your code.


#2

Hi this line

if number (%2===0)

you should put the if condition around ()

if (condition) {

}
else {

}

#3

Yes, you´re right. Thank you.


#4

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