gt()
gt(
value,other):boolean
Checks if value is greater than other.
DEPRECATED
Use the > operator directly instead.
Parametersβ
value: numberβ
The value to compare.
other: numberβ
The other value to compare.
Returns: booleanβ
true if value is greater than other, else false.
See Alsoβ
Sinceβ
2.0.0
Also known asβ
gt (Lodash, Ramda) Β· β (es-toolkit, Remeda, Radashi, Effect, Modern Dash, Antfu)
Exampleβ
// β Deprecated approach
gt(3, 1); // => true
gt(3, 3); // => false
gt(1, 3); // => false
// β
Recommended approach
3 > 1; // => true
3 > 3; // => false
1 > 3; // => false
How it works?β
Checks if value is greater than other.
Deprecated: Use > operator directly.
Native Equivalentβ
// β gt(a, b)
// β
a > b
Use Casesβ
Compare greater than πβ
Check if first value is greater than second.
a > b;
Validate thresholdβ
Check if value exceeds threshold.
if (score > passingScore) {
console.log('Passed!');
}