1. if/else wrong or not?


#1

Hello,
It is working but i dont know wrong or not? Is it possible to write like this?

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


#2

Yes, it's okay to write it like that but you can shorten your code by one line by writing.

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

#3

The rest is fine. :slight_smile: