Return false!


#1



Could someone explain to me why this keeps on returning false?


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

isEven(2);


Thanks :smile:


#2

Two problems:

  1. You are supposed to take the remainder (%) and not the quotient(/).
  2. Check your dividend on this line: if(isEven / 2 === 0).

Because you were dividing a function by 2, you were getting NaN which did not equal 0. Hence, it was always returning false.


#3

Replace isEven in the if statement with number and the / with %


#4

isEven is a function.


#5

Okey hope you found the solution