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);
}