Console is logging false when number = 3


Here is the code I have:
var isEven = function(number) {
// Your code goes here!
if(isEven %2){
return "false"
}else{ return"true"

If I could have help with figuring this out it would be great.


You are returning a string Value 'true'
instead of the required Boolean Value true
in your IF-condition you should use a comparison suing the comparison-operator
number%2 === 0


And as automatically correct :smile:
it should be number and not isEven. Because isEven is a function and taking the modulo of a function doesn't make much sense.


var isEven = function(number) {
if (number%2===0){
return ("true");


Remove the quotes from around true and false they are turning them into strings


The problem is that non-empty strings are treated as true so both "true" and "false" act as true if for example a test function would ask for if(isEven(3))


Thanks Bro :smile: it did solve the issue


Thanks Bro :smile: i did get that after a while :smile:


Thanks for that!
I really couldn't figure that out by myself.