If else More flow


#1

I get an error msg saying my function returns false when it is divisible by 2. Why ?

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

};`


#2

Instead of

if (isEven % 2 === 0)

it should read

if (number % 2 === 0)

because you are comparing the number that was entered as the parameter, not the function itself. Make sense?


#3

No, I wasn't sure, thanks.


#4

It works now. Thanks.


#5

@mccbjnn No problem :smiley: Have fun!