Ajax-loader-large-white
More on Control Flow in JS
If / else

You've learned about if and else, and how they control what your program does. Here's a quick refresher on the syntax:

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

Write an if / else statement inside the isEven function. It should return true; if the number it receives is evenly divisible by 2. Otherwise (else), it should return false;.

Make sure to return - don't use console.log()!

?
Stuck? Get a hint! Hint
Get live, fast support from Codecademy Advisors when you get stuck. Learn more.

Remember, you can use modulo (%) to see if a number is evenly divisible by another number.

Be sure to return true; or return false; in your codeā€”don't console.log()!

script.js