I need help with this plz :)


#1

var isEven = function(number) {
if(number % 2 ){
return true;
}
else {
return false;
}
};
it says this when I run it: Oops, try again. Looks like your function returns false when number = 2. Check whether your code inside the if/else statement correctly returns true if the number it receives is even.


#2

if(number % 2 ){ // complete this

it would be like

if(number % 2 ==0){

now call the isEven function.you have to pass argument.like

isEven(arg) // write the real value

check this how to call a function


#3

Yeah that worked thanks! though, I do not get why we do if(number % 2 ==0){ instead of if(number % 2 ){
thanks


#4

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