Ramda’s R.lte() answers an ordering question: is the first value less than or equal to 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.lt, R.gt, and R.gte cover the other comparison directions. R.max and R.min pick a value rather than return a Boolean. Previous helper is R.lt. Next is R.max.
The official samples cover the whole idea. R.lte(2, 1) is false. R.lte(2, 2) is true — less-than-or-equal, not strict <. R.lte(2, 3) is true. Strings compare lexicographically: R.lte('a', 'z') is true; R.lte('z', 'a') is false.
Syntax
Call R.lte. Start with this line.
Ramda
R.lte(a, b)
Call
What it does
R.lte(a, b)
Primary signature.
R.lte(...)
Call the relation helper.
Prefer import { lte } from "ramda" when you want a named import.
Library declarations
Ramda
R.lte(a, b)
Parameters
Parameter
Description
a
Required. Ord. First value — must be less than or equal to 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 strictly 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. Less-than-or-equal: equal pairs return true.
That is the docs sample from ramdajs.com. 2 <= 3 is true. 2 <= 2 is also true because R.lte is inclusive, not strict <. Strings compare lexicographically: 'a' <= 'z' is true.
Example 2 — vs R.lt, R.gt, and R.gte on the Same Pairs
Run all four ordering cousins on (2, 2) and (2, 3). Highlight: R.lte(2, 2) is true while R.lt(2, 2) is false.
On equal pairs, R.lte and R.gte both 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 same-day Date ordering.
Example 3 — Curried Filter with R.lte(R.__, 10)
Fix the upper bound with the placeholder. Keeps elements at or below 10, including 10 itself.
R.propSatisfies reads age from each record and passes it to R.lte(R.__, 18). Ada at 16 and Bob at exactly 18 both pass because R.lte is inclusive. Cy at 21 fails. Use R.lt when equal should not pass.
Example 5 — Same-Day Date Comparison
Dates are ordered by their time values. Same calendar day counts as less-or-equal.
Ramda
R.lte(new Date('2024-06-01'), new Date('2024-06-01'));
//=> true
JavaScript coerces Dates to numbers when compared with <=. Two Dates with the same time value satisfy R.lte. With strict R.lt, the same pair would return false.
Compatibility
Browser Support
R.lte() 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.lte()
Load Ramda 0.1.0 or later via CDN or npm, then call R.lte 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.lte()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.lte(a, b) returns true when the first argument is less than or equal to the second, false otherwise. Type: Ord a => a → a → Boolean. Arity 2, curried. Added in v0.1.0.
R.lte(2, 1) is false. R.lte(2, 2) is true. R.lte(2, 3) is true. R.lte('a', 'z') is true. R.lte('z', 'a') is false.
R.lte is less-than-or-equal (<=). R.lt is strict less-than (<). R.lte(2, 2) is true; R.lt(2, 2) is false.
R.lte tests whether a <= b. R.gte tests whether a >= b. On equal pairs both return true. On (2, 3), R.lte is true and R.gte is false.
Yes. Any ordered type that JavaScript can compare with <= works — numbers, strings (lexicographic), and Dates (by time value). Same-day Dates return true.
No. R.lte is a stable Ramda relation helper from v0.1.0. It is not deprecated, experimental, or non-standard.