1/14 your function returns false when number = 3


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

then I get this "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."

Isn't this code doing what I want it to by returning "false" when odd numbers are not divisible by 2?


Well you're trying to get "odd" numbers.

so change:

if(number % 2 === 0){


if(number % 2 === 1){

This way you'll get all odd numbers, instead of even numbers.


Judging by the name of the function, isEven, one suspects we would return true if number is even. That would be the goal, but the error message seems to run completely contrary to this.

The sensible approach would be,

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

An odd argument should return false. If the lesson checker won't let this pass, then switch around the return values.


Its the quotes around ("true") and ("false"),it should be return true; and return false;


this was the fix I was looking for, thanks!