296 B
296 B
title, tags
| title | tags |
|---|---|
| isOdd | math,beginner |
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