Ramda.js R.gte() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Relation

Definition

Ramda’s R.gte() answers an ordering question: is the first value greater 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.gt, R.lt, 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.gt. Next is R.identical.

The official samples cover the whole idea. R.gte(2, 1) is true. R.gte(2, 2) is also true — greater-than-or-equal, not strict >. R.gte(2, 3) is false. Strings compare lexicographically: R.gte('z', 'a') is true; R.gte('a', 'z') is false.

Syntax

Call R.gte. Start with this line.

Ramda
R.gte(a, b)
CallWhat it does
R.gte(a, b)Primary signature.
R.gte(...)Call the relation helper.

Prefer import { gte } from "ramda" when you want a named import.

Library declarations
Ramda
R.gte(a, b)

Parameters

ParameterDescription
aRequired. Ord. First value — must be greater 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 less. 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. Greater-than-or-equal: equal pairs return true.

Ramda
R.gte(2, 1);
//=> true

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

R.gte(2, 3);
//=> false

R.gte('a', 'z');
//=> false

R.gte('z', 'a');
//=> true
Try It Yourself

How It Works

That is the docs sample from ramdajs.com. 2 >= 1 is true. 2 >= 2 is also true because R.gte is inclusive, not strict >. Strings compare lexicographically: 'z' >= 'a' is true.

Example 2 — vs R.gt and R.lte on the Same Pairs

Compare ordering cousins on (2, 2) and (2, 3). Highlight: R.gte(2, 2) is true while R.gt(2, 2) is false.

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

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

How It Works

On equal pairs, R.gte and R.lte both return true because they are inclusive. R.gt is false on (2, 2) because it requires strict greater-than. On (2, 3), only R.lte returns true.

📈 Practical Patterns

Curried filters with placeholder, R.until stop predicates, then same-day Date ordering.

Example 3 — Curried Filter with R.gte(R.__, 10)

Fix the threshold with the placeholder. Keeps elements at or above 10, including 10 itself.

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

How It Works

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

Example 4 — Stop Predicate in R.until

R.until uses R.gte as a stop condition. Double until the value reaches 16.

Ramda
R.until(R.gte(R.__, 16), R.multiply(2))(1);
//=> 16
Try It Yourself

How It Works

Starting at 1, Ramda applies R.multiply(2) repeatedly: 1 → 2 → 4 → 8 → 16. The stop predicate R.gte(R.__, 16) returns true when the value reaches 16, so iteration stops.

Example 5 — Same-Day Date Comparison

Dates are ordered by their time values. Same calendar day counts as greater-or-equal.

Ramda
R.gte(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.gte. With strict R.gt, the same pair would return false.

Browser Support

R.gte() 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.gte()

Load Ramda 0.1.0 or later via CDN or npm, then call R.gte 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.gte() 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.gte(a, b) returns true when the first argument is greater than or equal to the second, false otherwise. Type: Ord a => a → a → Boolean. Arity 2, curried. Added in v0.1.0.
R.gte(2, 1) is true. R.gte(2, 2) is true. R.gte(2, 3) is false. R.gte('a', 'z') is false. R.gte('z', 'a') is true.
R.gte is greater-than-or-equal (>=). R.gt is strict greater-than (>). R.gte(2, 2) is true; R.gt(2, 2) is false.
R.gte tests whether a >= b. R.lte tests whether a <= b. On equal pairs both return true. On (2, 3), R.gte is false and R.lte is true.
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.gte is a stable Ramda relation helper from v0.1.0. It is not deprecated, experimental, or non-standard.

Continue to R.identical()

Learn reference-identity testing with Object.is semantics and how it differs from R.equals.

R.identical() 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