isGreaterThan
Checks whether the number is greater than another value. Set allowEqual to true when the boundary value should also pass, such as validating a minimum required count.
Usage
ts
const isAboveMinimum = (10).isGreaterThan(5);
// trueParameters
| Name | Type | Description |
|---|---|---|
value | number | Number to compare against. |
allowEqual | boolean | When true, equality is accepted. |
Returns
true when the number is greater than value, or greater than or equal when allowEqual is true.
Type signature
ts
interface Number {
isGreaterThan(value: number, allowEqual?: boolean): boolean;
}