397 B
397 B
title, type, language, tags, cover, dateModified
| title | type | language | tags | cover | dateModified | |
|---|---|---|---|---|---|---|
| Number is odd | snippet | javascript |
|
flower-portrait-5 | 2020-10-20T23:02:01+03:00 |
Checks if the given number is odd.
- Check whether a number is odd or even using the modulo (
%) operator. - Return
trueif the number is odd,falseif the number is even.
const isOdd = num => num % 2 === 1;
isOdd(3); // true