1. stuck with if/else


#1

var isEven = function(number) {
if(isEven % == 0){
return true;
}

  else{return false;}

};


#2

Your code looks quite good, there is only one problem - condition of the if:

if(isEven % == 0){

You need to actually check if number (the parameter) is even. And number is even when it can be divided exactly by 2. So you need something like this:

if(number % 2 === 0) {

#3

Thanks a lot bud, now I understand!


#4

You're very welcome.


#5

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