Oops, try again. Your function returns true for 3!


#1



Replace this line with your code.


#2

Can you please paste in your code so we can help you


#3

var isEven = function(number) {
   var x = number%2;
  if (isNaN(number))  {
      return"Input is not a number";
  } else if (x===0) {
   
    return"Your Number is even";
 
   }else {
    return"Your Number is odd";
  }
};
isEven("198");

#4

Please see the code pasted above. My code works as expected but I am not sure why I am getting "Oops, try again.
Your function returns true for 3!
" thanks for your help


#5

your if and is missing its closing curly brackets (})


#6

Sorry , didn't get what you are saying ...I don't see missing curly brackets in my code


#7

never mind, i guess i missed it. Let me have another look. My apoligizes


#8

okay, sorry about that. You should return true for even number, and you should return false for odd number, you are returning strings


#9

No worries . One of my colleagues looked at my code - he said the last return"Your Number is odd"; was causing the issue. I changed it to return false; and it worked !