Check if a number is even

// Write a function that takes a number as argument
// If the number is even, return true
// Otherwise, return false
function
myFunction
(
a
)
{

return
}
Test Cases:
myFunction(10)
Expected
true
myFunction(-4)
Expected
true
myFunction(5)
Expected
false
myFunction(-111)
Expected
false

How to solve it

The most common solution for this Javascript problem is to use the Remainder operator % (sometimes also referred to as Modulo operator).
The Remainder operator returns the remainder of an Integer division. For example: 10 % 3 returns 1 because the number 3 fits no more than 3 times in 10. 3x3 is 9. Thus, the Remainder of 10 % 3 is 10-9=1.
Now, how do we make use of the Remainder/Modulo operator to find out if a number is even oder odd? Well, we have to account for the fact that every even number is divisible by 2 while every odd number is not. So, evenNumber % 2 will always return zero. oddNumber % 2 will always return a number different from zero.