Files
30-seconds-of-code/snippets/js/s/is-even.md
2023-05-07 16:07:29 +03:00

404 B

title, type, language, tags, cover, dateModified
title type language tags cover dateModified
Number is even snippet javascript
math
by-the-lighthouse 2020-10-20T23:02:01+03:00

Checks if the given number is even.

  • Checks whether a number is odd or even using the modulo (%) operator.
  • Returns true if the number is even, false if the number is odd.
const isEven = num => num % 2 === 0;
isEven(3); // false