1/9 "Oops try again" even though code works


here's my code:

var isEven = function(number) {
    if (number % 2 === 0) {
    else {


it returns true if the value is even, false if not. I'm getting this error message:

"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."

it's supposed to return false if the number is odd, no?

I'm so confused, what am I missing?!


Yes but the point is you don't return true and false but "true" and "false". The first are booleans and the second are strings. Now the problem is that non-empty strings used in conditions behave like true so both "true" and "false" will behave truthy when a hypothetical test function asks for e.g.



ah, of course! booleans! thanks for your help