30 seconds of code

  Back to Home

isOdd

mathbeginner

Returns true if the given number is odd, false otherwise.

Checks whether a number is odd or even using the modulo (%) operator. Returns true if the number is odd, false if the number is even.

const isOdd = num => num % 2 === 1;