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

x/fun/mod.ts>boolean.compare

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function boolean.compare
import { boolean } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { compare } = boolean;

Compares two booleans, returning an Ordering. True is greater than False in this ordering, generally, but the specifics are always decided by the runtime.

Examples

Example 1

import { compare } from "./boolean.ts";

const result1 = compare(true, true); // 0
const result2 = compare(true, false); // 1
const result3 = compare(false, true); // -1

Parameters

first: boolean
second: boolean

Returns

Ordering