Ramda.js R.lte() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Relation

Definition

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)
CallWhat 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

ParameterDescription
aRequired. Ord. First value — must be less than or equal to b for true. Not mutated.
bRequired. Ord. Second value to compare against. Not mutated.

Return Value

Return ValueDescription
Booleantrue 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.

Ramda
R.lte(2, 1);
//=> false

R.lte(2, 2);
//=> true

R.lte(2, 3);
//=> true

R.lte('a', 'z');
//=> true

R.lte('z', 'a');
//=> false
Try It Yourself

How It Works

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.

Ramda
R.lt(2, 2);  R.lte(2, 2);  R.gt(2, 2);  R.gte(2, 2);
//=> false    //=> true     //=> false    //=> true

R.lt(2, 3);  R.lte(2, 3);  R.gt(2, 3);  R.gte(2, 3);
//=> true     //=> true     //=> false    //=> false
Try It Yourself

How It Works

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.

Ramda
R.filter(R.lte(R.__, 10), [8, 10, 12, 9]);
//=> [8, 10, 9]
Try It Yourself

How It Works

R.lte(R.__, 10) waits for the first argument. R.filter passes each list element. 8, 9, and 10 are at or below the threshold. 12 fails.

Example 4 — R.propSatisfies with R.lte(R.__, 18)

Build a record predicate that checks whether a user’s age is at or below a threshold.

Ramda
const isAtOrUnder18 = R.propSatisfies(R.lte(R.__, 18), 'age');

R.filter(isAtOrUnder18, [
  { name: 'Ada', age: 16 },
  { name: 'Bob', age: 18 },
  { name: 'Cy', age: 21 }
]);
//=> [{ name: 'Ada', age: 16 }, { name: 'Bob', age: 18 }]
Try It Yourself

How It Works

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
Try It Yourself

How It Works

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.

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 Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All 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.

Continue to R.max()

Learn how to pick the larger of two ordered values and fold R.max across lists with R.reduce.

R.max() Method →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

6 people found this page helpful