Many people are struggling with this. That is all right code


#1

var isEven = function(number) {
    if (number % 2 === 0) {
        return true; 
    }
    else if (number % 2 > 0) {
        return false;
    }
    else if (isNaN(number)) {
        return "Your input must be numeric!";    
    }
};

isEven("dog");

#2

But you should be ending with an else after an else if right?


#3

I am not sure but codecademy itsel said it is right and let me go to the next level.


#4

Yeah, it depends on the aim of that exercise I want to guess. Just outside convention.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.