Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/isx/number/is_non_negative_integer.ts>isNonNegativeInteger

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

Whether the input is non negative integer or not.

Examples

Example 1

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

Parameters

input: number
  • Any number.

Returns

boolean