Skip to content

Function: isOdd()

ts
function isOdd(value): boolean;

Checks if a number is odd. 检查数字是否为奇数。

Parameters

ParameterTypeDescription
valuenumberThe number to check / 要检查的数字

Returns

boolean

True if the number is odd / 如果是奇数返回true

Example

typescript
isOdd(3) // => true
isOdd(2) // => false
isOdd(1) // => true

Since

1.0.0

Released under the MIT License.