5. 1. if/else


#1

Can someboy tell me what is wrong about my code?

var isEven = function(number) {
// Your code goes here!
return number % 2
};

if (isEven (5) === 0) {
console.log (true)
} else { console.log (false)
}


#2

this statement is not complete because to check if a number is even you must also include === 0 so like,

number % 2 === 0


#3

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