Why am I getting error?


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


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

Replace this line with your code.


you should return Boolean values, you return strings, remove the " around false and true


I tried that already but received same error.
Looks like some issue from code academy.
Now same code works.


your else missing a few curly brackets ({}). if, else if and else should all have curly brackets:

if (condition){

} else if (other condition){

} else {


if problems persist, post an updated version of your code


If you have a single line of code for the body part of else/if/else if, you can skip the braces.
However, the code works now.
Thanks for your help. :slight_smile: