JS Unit 5.2: More on Flow in JS, please help find error


var isEven = function(number) {
return "It is divisible by 2";

}else if (isNaN(number)){
return"That's not a number";

}else {
return "It is not divisible by 2";


This is my code, it gives an error saying "Oops, try again. Your function returns true for 3!" but when I put in 3, it gives me my string saying it's not divisible by 2. I can't figure out why I'm getting an error.


Perhaps the submission test expects booleans to be returned, and interpret your strings as true since they are non-empty?

for (var i = 3; i < 1000; i+=2) {
    return "Your function returns true for " + i + "!";