More on control flow on js..lesson 1..how to solve?


#1



Replace this line with your code.


#2

What are you confused about?

Explain what is causing you trouble. :slight_smile:


#3

var isEven = function(number) {
// Your code goes here!
if(number ){
number/2;
return "true";

}
else{
return "false";
}
};
console.log(number(4));
it doesn't work!


#4

your condition is wrong

if (/* Some condition */) {
    // Do something
} else if (/* Some other condition */) {
    // Do something else
} else {    // Otherwise
    // Do a third thing
}

what do you mean by "if(number)"
do you know "if(number)" means "if(number==true)"
But you have to do something else.
It should return true; if the number it receives is evenly divisible by 2
see the Instructions carefully :slight_smile:

@mithu_samia