# [JavaScript] Numbers, Dates, Intl, and Timers - The Remainder Operator

```
// Remainder Operator
console.log(5 % 2);
console.log(5 / 2); // 5 = 2 * 2 + 1

console.log(8 % 3);
console.log(8 / 3); // 8 = 2 * 3 + 2

console.log(6 % 2);
console.log(6 / 2); // 6 = 3 * 2

console.log(7 % 2);
console.log(7 / 2); // 7 = 3 * 2 + 1

const isEven = n => n % 2 === 0;
console.log(isEven(8));
console.log(isEven(23));
console.log(isEven(514));

labelBalance.addEventListener('click', function () {
  [...document.querySelectorAll('.movements__row')].forEach(function (row, i) {
    // every N time
    if (i % 2 === 0) row.style.backgroundColor = 'orangered';
    if (i % 3 === 0) row.style.backgroundColor = 'blue';
  });
});
```

![the remainder operator 1.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1657849490721/lNWgV5qDm.PNG align="left")

![the remainder operator 2.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1657849495193/1g-9t_ZuA.PNG align="left")

