Files
30-seconds-of-code/snippets/isEven.md
Angelos Chalaris 611729214a Snippet format update
To match the starter (for the migration)
2019-08-13 10:29:12 +03:00

17 lines
325 B
Markdown

---
title: isEven
tags: math,beginner
---
Returns `true` if the given number is even, `false` otherwise.
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.
```js
const isEven = num => num % 2 === 0;
```
```js
isEven(3); // false
```