I dont see my error



var isEven = function(number) {
  // Your code goes here!
      return true;
      return  false;



if the remainder of number divided by two equals zero, return true

the equals zero bit is missing in your case


thanks for the help!


look at/run this code:

if (0){
    console.log("0 is true")
} else {
    console.log("0 is false")
if (1){
    console.log("1 is true")
} else {
    console.log("1 is false")

if the number is even, the remainder is zero, so the condition is false, else runs. When the number is odd, the remainder is one, the condition is true, so if runs.

So you don't have to check if the remainder equals zero, but then you have to swap return true and return false around

If this makes sense, very good, if not, just move on :slight_smile:


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