Skip to content

gt() function

如果第一个参数大于第二个参数则返回 true,否则返回 false。

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.