Skip to content

gt() function

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

Signature:

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

Example

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

filter(gt(5), [1, 2, 4, 5, 8, 9]) // Iterable<[1, 2, 4]>
filter(gt(1), [1, 2, 3, 4, 5]) // Iterable<[]>
filter(gt("b"), ["a", "b", "c"]) // Iterable<["a"]>
filter(gt("a"), ["a", "b"]) // Itreable<[]>

Open Source Code

Released under the Apache-2.0 License.