Need help in simple if/else? stuck with using function,


Oops, try again. Looks like your function returns false when number = 3. Check whether your code inside the if/else statement correctly returns true if the number it receives is odd.

var isEven = function(number) {
if(isEven % 2) {
return "its evenly devisible";
} else {
return "its not evenly devisible";


On the last line: isEven(); you should call the function with an argument, like this: isEven(3);
The expression isEven % 2 should be number % 2 === 0 - it checks if your argument is even


It does not help the user in any way if you give him the 'finished code'without an explanation. :slight_smile:


If you are referring to the instructions given on the lesson he is on, how would you be helping him/her by just giving the solution?


my bad, thanks 4 ur help...


your condition in if/else should be: number % 2 === 0. It means that condition will be true only if the parameter sent was even number.


thanks i solved it, Appreciated everyone...


A post was split to a new topic: If/else