Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/isx/number/is_odd.ts>isOdd

Collection of validation functions for JavaScript data
Go to Latest
function isOdd
import { isOdd } from "https://deno.land/x/isx@1.1.1/number/is_odd.ts";

Whether the input is odd or not.

Examples

Example 1

import { isOdd } from "https://deno.land/x/isx@$VERSION/number/is_odd.ts"
import { assertEquals } from "https://deno.land/std/testing/asserts.ts"
assertEquals(isOdd(1), true)
assertEquals(isOdd(0), false)

Parameters

input: number
  • Any number.

Returns

boolean