Create GSwP- 21 of 28

if( 4 % 2 === 0 ) 
{
    console.log("The first number is even");
} 
else 
{
    console.log("The first number is odd");
}


/*


I originally used an odd number (5) and got the following warning dialog

"Oops, try again. It looks like your comparison in line 5 doesn't evaluate to true! Check the Hint if you need help."

The Output was "The first number is odd" which is false so it outputs the else result - "The first number is odd"






Original code:


//An example of an if/else statement with modulo in the condition



if(  ) {
    console.log("The first number is even");
} else {
    console.log("The first number is odd");
}


Modulo and if / else
So why learn modulo? For one thing, it's good at testing divisibility. Consider 30 % 10. What does it return? There is nothing left over, so 0.

How about 9 % 3? Also 0.

We can use modulos in comparisons, like this:

10 % 2 === 0 evaluates to true
7 % 3 === 0 evaluates to false because there is 1 left over.

Instructions
Let's get the if/else" statement to display "The first number is even".

Edit line 5 by adding a comparison that evaluates to true.
In the comparison, use a modulo and an even number, like we did in the example above.



*/