Skip to main content

lte

lte() function

Returns true if the first argument is less or equal than the second; false otherwise.

Signature:
declare function lte(a: Date, b: Date): boolean;

declare function lte(a: Date): (b: Date) => boolean;

declare function lte(a: string, b: string): boolean;

declare function lte(a: number, b: number): boolean;

declare function lte(a: string): (b: string) => boolean;

declare function lte(a: number): (b: number) => boolean;

Example

lte(5, 1) // expected false
lte(1, 1) // expected true
lte(1, 5) // expected true
lte("a", "b") // expected true
lte("b", "a") // expected false

filter(lte(5), [1, 2, 4, 5, 8, 9]) // Iterable<[5, 8, 9]>
filter(lte(9), [6, 7, 8]) // Iterable<[]>
filter(lte("b"), ["a", "b", "c"]) // Iterable<["b", "c"]>
filter(lte("e"), ["c", "d"]) // Itreable<[]>