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

x/isx/number/is_even.ts>isEven

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

Whether the input is even or not.

Examples

Example 1

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

Parameters

input: number
  • Any number.

Returns

boolean