More on Control


#1

I don't know why this is not working as a solution:

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

isEven(12);


#2

it should rather be

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

console.log(isEven(12));
console.log(isEven(13));

You can shorten the implementation to this

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

console.log(isEven(12));
console.log(isEven(13));