If / else


#1

What is wrong with this code:


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


#2

if a number is even, the remainder is zero, so else will run. So else should return true, and if should return false, or you should compare the remainder with zero

Also, true and false should be boolean values, not strings


If/else why should else return true and if false
#3

Thanks! :joy: :joy: :joy:


#4