1. If/Else


#1

I'm stuck! I tried everything and it doesn't work. Here is my code:

var isEven = function(number) {
if(number % 2){
return "true";
} else {
return "false";
}

};

it just says:

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.

Please help!


#2

there should be: === 0 and no quotes on true and false

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


#3

Thank you! :yum: I've been stuck on this forever!