Whats wrong over here?


#1

var isEven = function(number)

if(number % 2 === 0) {
return true;
} else {
    return false;

}


#2

You probably want to make isEven a function. Then write it like this

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

Also, you can check if (result === 0) if you set result = number % 2 before or put your if condition in () before to check if it's equal to 0.


#3

nops! isill not working.


#4

You did make the var isEven one word when you copied and pasted it didn't you?


#5

i get this "Oops, try again. Looks like your function returns false when number = 3. Check whether your code inside the if/else statement correctly returns true if the number it receives is odd."


#6

Can you post your code please?


#7

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


#8

Nevermind! i was being stupid!