What is wrong with my code?


#1

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


#2

This is for : More on Control Flow in JS 1. If / else


#3

I entered this and it seems to get an error code yet returns what they ask for...
var isEven = function(number) {
if(number % 2 === 0){
return "It is";
}
else if(isNaN (isEven)){
return "Input isn't a Number";

     } 
else {
         return "Input isn't a Number";
         }

}
isEven(37);


#4

i get this error code


#5

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


#6

first of all referring to your original code which wasn't far from correct, you have an error
You have to add a closing brace at the end of this line

and it should work


#7

Thanks!!!:slightly_smiling::yum: