Ramda.js R.all() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
List

Definition

R.all(fn, list) answers one yes-or-no question: does every item pass the test? It returns true when the predicate fn passes for all items, and false at the first item that fails (official Ramda docs). It is the curried, predicate-first version of Array.prototype.every.

Stable since v0.1.0: R.all is one of Ramda’s original list functions. It is not deprecated, experimental, or non-standard.

Syntax

Call R.all. Start with this line.

Ramda
R.all(fn, list) or R.all(fn)(list)
CallWhat it does
R.all(fn, list) or R.all(fn)(list)Primary signature.
R.all(...)Call the list helper.

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

Library declarations
Ramda
R.all(fn, list) or R.all(fn)(list)

Parameters

ParameterDescription
fnRequired. Predicate called with each item (no index); the result is treated as truthy or falsy
listRequired. Array to check — never changed

Return Value

Return ValueDescription
*true if no item fails, otherwise false

Ramda Examples

Example 1 — Official equals3 Samples

Four threes pass; one 1 among them fails — the samples from the Ramda docs.

Ramda
const equals3 = R.equals(3);

console.log(R.all(equals3)([3, 3, 3, 3])); // true
console.log(R.all(equals3)([3, 3, 1, 3])); // false
Try It Yourself

How It Works

  1. Build the test. R.equals(3) returns a function that is true only for 3.
  2. Curry. R.all(equals3) waits for a list, so R.all(equals3)(list) equals R.all(equals3, list).
  3. First list. All four items pass, so the result is true.
  4. Second list. The 1 fails, so the result is false.

Example 2 — Empty List Is true

No item can fail an empty list. Add a length check when “nothing” should not count as valid.

Ramda
const isPositive = n => n > 0;

console.log(R.all(isPositive, [])); // true

const allPositive = R.both(R.complement(R.isEmpty), R.all(isPositive));

console.log(allPositive([]));     // false
console.log(allPositive([4, 9])); // true
Try It Yourself

How It Works

  1. Empty input. The loop never runs, so R.all returns true — just like [].every(fn).
  2. Not empty. R.complement(R.isEmpty) is true only for a list with items.
  3. Combine. R.both needs both checks to pass, so [] now gives false.
  4. Normal list. [4, 9] is non-empty and all positive, so it gives true.

Example 3 — It Stops at the First Fail

Record every item the predicate sees to watch the early exit.

Ramda
const checked = [];
const isEven = n => {
  checked.push(n);
  return n % 2 === 0;
};

console.log(R.all(isEven, [2, 4, 5, 6, 8])); // false
console.log(checked);                        // [2, 4, 5]
Try It Yourself

How It Works

  1. Track calls. isEven pushes each item into checked before testing it.
  2. Pass, pass. 2 and 4 are even, so the walk continues.
  3. Fail. 5 is odd, so R.all returns false immediately.
  4. Skipped. 6 and 8 are never checked — checked is [2, 4, 5].

Example 4 — Check a List of Objects

Are all users active? Build the predicate with R.propEq.

Ramda
const isActive = R.propEq(true, 'active');

const users = [
  { name: 'Ada', active: true },
  { name: 'Linus', active: true }
];
const withGrace = R.append({ name: 'Grace', active: false }, users);

console.log(R.all(isActive, users));     // true
console.log(R.all(isActive, withGrace)); // false
Try It Yourself

How It Works

  1. Build the test. R.propEq(true, 'active') checks user.active === true (value first since Ramda v0.29).
  2. All active. Ada and Linus both pass, so the first result is true.
  3. Add Grace. R.append returns a new list with an inactive user at the end.
  4. One fails. Grace’s active is false, so the second result is false.

Example 5 — A Reusable Checker with R.filter

Leave out the list to get a named function, then keep only the teams where everyone passed.

Ramda
const allPassed = R.all(score => score >= 50);

const teams = [[72, 88, 95], [64, 41, 90], [50, 77]];

console.log(R.filter(allPassed, teams)); // [[72, 88, 95], [50, 77]]
console.log(allPassed([64, 41, 90]));    // false
Try It Yourself

How It Works

  1. Curry. R.all(score => score >= 50) has no list yet, so allPassed is a function waiting for one.
  2. Filter. R.filter calls allPassed on each team (each inner array).
  3. Drop a team. [64, 41, 90] contains 41, so allPassed returns false and the team is removed.
  4. Keep the rest. 50 >= 50 is true, so [50, 77] stays.

Browser & Runtime Support

R.all() is plain JavaScript inside Ramda (available since v0.1.0). It uses no browser API, so support depends only on loading Ramda.

✓ Ramda 0.1.0+ · Any JS runtime

Ramda.js R.all()

The UMD build (ramda.min.js) is compiled to ES5 syntax, so it runs in Chrome, Firefox, Safari, and Edge. Via npm it works in Node.js, Deno, and Bun with require or import. The arrow functions in some examples need an ES2015+ engine, which every modern browser has.

100% With Ramda loaded
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Internet Explorer No native support · Use a polyfill
Polyfill
Opera Supported · Modern versions
Full support
Samsung Internet Supported · Android
Full support
Bun Supported · JavaScript runtime
Supported
Deno Supported · JavaScript runtime
Supported
Node.js Supported · Server runtime
Supported
Android WebView Supported · Modern WebView
Full support
R.all() Universal

Bottom line: Safe in any project that includes Ramda. Example 4 uses the value-first R.propEq order, which needs Ramda 0.29.0 or later. Load ramda.min.js from a CDN in the browser, or npm install ramda for Node, Deno, and Bun. These labs load [email protected] from jsDelivr.

Frequently Asked Questions

R.all(fn, list) returns true if every item in the list passes the predicate fn, and false as soon as one item fails. Official sample: with equals3 = R.equals(3), R.all(equals3)([3, 3, 3, 3]) is true and R.all(equals3)([3, 3, 1, 3]) is false.
There is no item that fails, so the claim 'every item passes' holds. This is called vacuous truth, and native [].every(fn) also returns true. If an empty list should fail, check the length first, for example with R.both(R.complement(R.isEmpty), R.all(fn)).
R.all needs every item to pass. R.any needs at least one item to pass. R.none needs zero items to pass. For equals3 on [3, 3, 1, 3]: all is false, any is true, none is false.
Yes. It checks items from left to right and returns false at the first item whose predicate result is falsy. Items after that are never checked.
Both answer the same question. R.all is curried and takes the predicate first, so R.all(fn) is a reusable function. It also calls the predicate with the item only (no index), and it visits holes in sparse arrays as undefined, while every skips them.
No. R.all has been a stable Ramda list function since v0.1.0. It is not deprecated, experimental, or non-standard.

Next: R.any()

Return true when at least one item in a list passes your test.

R.any() tutorial →

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