Skip to content

isOdd ​

The isOdd function checks if a number is odd.

Syntax ​

typescript
isOdd(value)

Parameters ​

NameTypeDescription
valuenumberNumber to be checked.

Return Value ​

TypeDescription
booleantrue if the number is odd, else false.

Examples ​

typescript
isOdd(3); // true
isOdd(4); // false

Notes ​

  • Throws a TypeError if the value is not a number.
  • Useful for mathematical and logical validations.

References ​

Released under the MIT License.