Skip to content

@technobuddha > library > Math > Comparison

Function: isOdd()

ts
function isOdd(input: number): boolean;

Defined in: is-odd.ts:18

Tests to see if the specified value is an odd integer

Parameters

ParameterTypeDescription
inputnumberThe number to test

Returns

boolean

true if the number is an odd integer

Example

typescript
isOdd(1); // true
isOdd(2); // false
isOdd(0); // false
isOdd(-3); // true
isOdd(3.1); // false