Ramda’s R.lt() answers an ordering question: is the first value strictly less than the second? You pass two ordered values and get back a Boolean. It uses JavaScript’s < operator under the hood, so numbers, strings, and Dates all work. It is not equality — R.equals checks whether values match by deep structure. Cousins R.gt, R.gte, and R.lte cover the other comparison directions. R.max and R.min pick a value rather than return a Boolean. Previous helper is R.intersection. Next is R.lte.
The official samples cover the whole idea. R.lt(2, 1) is false. R.lt(2, 2) is false — strict less-than, not <=. R.lt(2, 3) is true. Strings compare lexicographically: R.lt('a', 'z') is true; R.lt('z', 'a') is false.
Syntax
Call R.lt. Start with this line.
Ramda
R.lt(a, b)
Call
What it does
R.lt(a, b)
Primary signature.
R.lt(...)
Call the relation helper.
Prefer import { lt } from "ramda" when you want a named import.
Library declarations
Ramda
R.lt(a, b)
Parameters
Parameter
Description
a
Required. Ord. First value — must be less than b for true. Not mutated.
b
Required. Ord. Second value to compare against. Not mutated.
Return Value
Return Value
Description
Boolean
true when a < b. false when equal or greater. Always a Boolean, never undefined.
Ramda Examples
📚 Getting Started
The official Ramda samples for numbers and strings.
Example 1 — Official Number and String Samples
Numbers and strings from the Ramda docs. Strict less-than: equal pairs return false.
That is the docs sample from ramdajs.com. 2 < 3 is true. 2 < 2 is false because R.lt is strict, not <=. Strings compare lexicographically: 'a' < 'z' is true.
Example 2 — vs R.gt, R.gte, R.lte on the Same Pairs
Run all four ordering cousins on (2, 2) and (2, 3) to see strict vs inclusive behavior. Note R.lt(2, 2) is false while R.lte(2, 2) is true.
On equal pairs, only R.gte and R.lte return true because they are inclusive. R.lt(2, 2) is false but R.lte(2, 2) is true — that is the strict vs inclusive split. On (2, 3), R.lt and R.lte return true because 2 is less than or equal to 3.
📈 Practical Patterns
Curried filters with placeholder, record predicates with R.propSatisfies, then earlier Date ordering.
Example 3 — Curried Filter with R.lt(R.__, 10)
Fix the upper bound with the placeholder. The result is a one-argument predicate for R.filter that keeps values strictly below 10.
R.lt(R.__, 10) waits for the first argument. R.filter passes each list element. Only values strictly less than 10 pass. 12 is excluded; 10 itself would also fail because R.lt is strict.
Example 4 — R.propSatisfies with R.lt(R.__, 18)
Build a record predicate that checks whether a user’s age is strictly below a threshold.
R.propSatisfies reads age from each record and passes it to R.lt(R.__, 18). Only Ada’s age of 16 is strictly less than 18. Bob at exactly 18 fails because R.lt is strict — use R.lte when equal should pass.
Example 5 — Earlier Date Comparison
Dates are ordered by their time values. January 2024 is before June 2024.
Ramda
R.lt(new Date('2024-01-01'), new Date('2024-06-01'));
//=> true
JavaScript coerces Dates to numbers when compared with <. Ramda delegates to the same operator, so any ordered type works the same way as native comparison. The first date is earlier, so R.lt returns true.
Compatibility
Browser Support
R.lt() is ordinary JavaScript once Ramda is loaded. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Ramda 0.1.0+ · Any JS runtime
Ramda.js R.lt()
Load Ramda 0.1.0 or later via CDN or npm, then call R.lt with two ordered values. No extra browser API is required.
100%With Ramda 0.1.0+
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
R.lt()Universal
Bottom line: Safe in any project that includes Ramda 0.1.0 or later. Use a CDN build such as ramda.min.js in the browser or install ramda from npm for Node. These labs use [email protected].
Frequently Asked Questions
R.lt(a, b) returns true when the first argument is strictly less than the second, false otherwise. Type: Ord a => a → a → Boolean. Arity 2, curried. Added in v0.1.0.
R.lt(2, 1) is false. R.lt(2, 2) is false. R.lt(2, 3) is true. R.lt('a', 'z') is true. R.lt('z', 'a') is false.
R.lt is strict less-than (<). R.lte is less-than-or-equal (<=). R.lt(2, 2) is false; R.lte(2, 2) is true.
R.equals tests deep value equality and returns true when values match. R.lt tests ordering and returns true only when the first value is strictly less than the second.
Yes. Any ordered type that JavaScript can compare with < works — numbers, strings (lexicographic), and Dates (by time value).
No. R.lt is a stable Ramda relation helper from v0.1.0. It is not deprecated, experimental, or non-standard.