lt()
lt(
value,other):boolean
Checks if value is less 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 less than other, else false.
See Alsoβ
Sinceβ
2.0.0
Also known asβ
lt (Lodash, Ramda) Β· β (es-toolkit, Remeda, Radashi, Effect, Modern Dash, Antfu)
Exampleβ
// β Deprecated approach
lt(1, 3); // => true
lt(3, 3); // => false
lt(3, 1); // => false
// β
Recommended approach
1 < 3; // => true
3 < 3; // => false
3 < 1; // => false
How it works?β
Checks if value is less than other.
Deprecated: Use < operator directly.
Native Equivalentβ
// β lt(a, b)
// β
a < b
Use Casesβ
Compare less than πβ
Check if first value is less than second.
a < b;
Check limitβ
Validate value is under limit.
if (items.length < maxItems) {
items.push(newItem);
}