Skip to main content
Module

x/fonction/mod.ts>gt

A modern practical functional library
Latest
variable gt
import { gt } from "https://deno.land/x/fonction@v2.1.0-beta.4/mod.ts";

Returns true if the first argument is greater than the second; otherwise false.

Examples

Example 1

// Number
gt(2, 1) // true
gt(2, 2) // false

Example 2

// Bigint
gt(2n, 1n) // true
gt(2n, 2n) // false

Example 3

// String
gt('z', 'a') // true
gt('a', 'z') // false

Example 4

// Boolean
gt(true, false) // true
gt(false, true) // false
gt(true, true) // false
gt(false, false) // false

Example 5

// Date
gt(new Date('2000/1/2'), new Date('2000/1/1')) // true
gt(new Date('1999/12/31'), new Date('2000/1/1')) // false
gt(new Date('2000/1/1'), new Date('2000/1/1')) // false

type

<T extends Ord>(a: T, b: T) => boolean