Control of the flow - 1. if\else


#1

Hey guy so my code looks like this :

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

Problem is that when I run it I get a pop up that :

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.

Any help will be much appreciated


#2

Hey @ronin85,

You put true and false as a string, that's the problem.