If/else question



Hello, I'd like to know why this code isn't considered right, am I supposed to use else if at all?

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


Thanks in advance!


You want to check if the parameter (number) you put into your function is even. Not the function itself.


I guess this explains all, thanks!


This is my code at the moment:

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


but i am getting:

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.

Can you help me understand why is that ?

Edit : Nevermind i found my mistake. I had to remove the " " from true and false.


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