Ramda.js R.allPass() Method

Beginner
5 min read
Updated: Nov 2026
5 examples
Logic

Definition

Ramda’s R.allPass() answers a logic question: do all of these tests pass for the same arguments? You pass an array of predicates. You get back one function. Call that leftover with a value (or several values). You get a boolean. Native JavaScript would write p1(x) && p2(x) && p3(x). allPass names that AND once, curries the leftover to the longest predicate, and short-circuits on the first false. Drop the leftover into R.filter and R.find.

The official sample is the whole idea. isQueen checks rank 'Q'. isSpade checks suit '♠︎'. Together they accept only the queen of spades. A queen of clubs fails. Need any one test to pass? That is R.anyPass. Need exactly two predicates? That is R.both. Need one predicate on every item of a list? That is R.all. Previous Object helper is R.whereEq. Next Logic helper is R.and.

Syntax

Call R.allPass. Start with this line.

Ramda
R.allPass(predicates)
CallWhat it does
R.allPass(predicates)Primary signature.
R.allPass(...)Call the logic helper.

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

Library declarations
Ramda
R.allPass(predicates)

Parameters

ParameterDescription
predicatesRequired. Array. Functions that return a boolean. Each is called with the same arguments you later pass to the leftover. An empty array is allowed.

Return Value

Return ValueDescription
FunctionA curried predicate. true when every listed predicate is true for those arguments. false at the first miss. An empty list yields a function that is always true.

Ramda Examples

📚 Getting Started

The official Ramda queen-of-spades sample, then the same idea compared with anyPass, both, and R.all.

Example 1 — Official Queen of Spades

Both predicates see the same card. Rank must be queen and suit must be spades. One miss is enough to yield false.

Ramda
const isQueen = R.propEq('Q', 'rank');
const isSpade = R.propEq('♠︎', 'suit');
const isQueenOfSpades = R.allPass([isQueen, isSpade]);

isQueenOfSpades({rank: 'Q', suit: '♣︎'});
//=> false

isQueenOfSpades({rank: 'Q', suit: '♠︎'});
//=> true
Try It Yourself

How It Works

Clubs fail isSpade, so the leftover is false even though rank is 'Q'. Spades pass both tests. That is the docs sample from ramdajs.com. In Ramda 0.30, propEq is value then name.

Example 2 — vs anyPass, both, and R.all

Same queen of spades. allPass and both are AND. anyPass is OR. R.all walks a list with one predicate.

Ramda
const isQueen = R.propEq('Q', 'rank');
const isSpade = R.propEq('♠︎', 'suit');
const card = { rank: 'Q', suit: '♠︎' };

R.allPass([isQueen, isSpade])(card);
//=> true

R.anyPass([R.propEq('K', 'rank'), isSpade])(card);
//=> true

R.both(isQueen, isSpade)(card);
//=> true

R.all(R.equals(3), [3, 3, 3]);
//=> true
Try It Yourself

How It Works

anyPass is true because the card is a spade even though rank is not king. both is the two-predicate form of allPass. R.all asks a different question: does every item in a list pass one function?

📈 Practical Patterns

A numeric range, a leftover whose arity is 2, then filter and find, then an empty list versus both.

Example 3 — Range, Arity, and Two Arguments

Partially applied helpers have arity 1. Unapplied binary helpers keep arity 2, so the leftover waits for two values.

Ramda
const inRange = R.allPass([R.gt(R.__, 0), R.lt(R.__, 10)]);

inRange(5);
//=> true

inRange(0);
//=> false

R.allPass([R.equals, R.identical])(1, 1);
//=> true

R.allPass([R.equals, R.identical])(1, '1');
//=> false
Try It Yourself

How It Works

R.gt(R.__, 0) has .length 1, so inRange is unary. R.equals and R.identical each have .length 2, so that leftover is curryN(2, …). R.equals(1, '1') is true in Ramda, but identical fails, so AND is false.

Example 4 — Filter and Find

Build one leftover from two field tests. Keep matching tickets. Find the first match.

Ramda
const pred = R.allPass([
  R.propEq('open', 'status'),
  R.propEq('blue', 'team')
]);

const rows = [
  { id: 1, status: 'open', team: 'blue' },
  { id: 2, status: 'done', team: 'blue' },
  { id: 3, status: 'open', team: 'red' }
];

R.filter(pred, rows);
//=> [{ id: 1, status: 'open', team: 'blue' }]

R.find(pred, rows);
//=> { id: 1, status: 'open', team: 'blue' }
Try It Yourself

How It Works

Filling the predicate list leaves a function of one object for R.filter and R.find. Row 2 fails status. Row 3 fails team. Name the tests once, reuse them on every row.

Example 5 — Empty List vs both

An empty predicate list never loops, so the leftover is always true. both is the two-predicate cousin. Three tests still AND.

Ramda
R.allPass([])(99);
//=> true

R.both(R.gt(R.__, 0), R.lt(R.__, 10))(5);
//=> true

R.allPass([R.gt(R.__, 0), R.lt(R.__, 10), R.equals(5)])(5);
//=> true

R.allPass([R.gt(R.__, 0), R.lt(R.__, 10), R.equals(5)])(7);
//=> false
Try It Yourself

How It Works

Vacuous truth: nothing failed, so the leftover is true. Prefer R.both when you will always have exactly two tests. Prefer allPass when the list can grow.

Browser Support

R.allPass() is ordinary JavaScript once Ramda is loaded. Logos use the shared browser-image-sprite.png sprite from this project.

✓ Ramda 0.9.0+ · Any JS runtime

Ramda.js R.allPass()

Load Ramda 0.9.0 or later via CDN or npm, then call R.allPass with an array of predicates. No extra browser API is required.

100% With Ramda 0.9.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.allPass() Universal

Bottom line: Safe in any project that includes Ramda 0.9.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.allPass(predicates) takes an array of predicate functions and returns one new predicate. That leftover is true only when every predicate is true for the same arguments. It is AND for functions. Added in v0.9.0. Type: [(*… → Boolean)] → (*… → Boolean).
isQueen = R.propEq('Q', 'rank'); isSpade = R.propEq('♠︎', 'suit'); isQueenOfSpades = R.allPass([isQueen, isSpade]). isQueenOfSpades({rank:'Q', suit:'♣︎'}) is false. isQueenOfSpades({rank:'Q', suit:'♠︎'}) is true.
allPass is AND of a list of predicates on the same arguments. anyPass is OR of that list. both ANDs exactly two predicates. R.all runs one predicate across every item in a list.
It matches the highest .length among the predicates. R.allPass([R.gt(R.__, 0), R.lt(R.__, 10)]) has arity 1. R.allPass([R.gt, R.lt]) has arity 2 because both helpers wait for two numbers.
R.allPass([]) returns a function that is always true. There is nothing to fail, so the leftover is vacuously true — the same idea as Array.prototype.every on [].
No. R.allPass is a stable Ramda logic helper from v0.9.0. It is not deprecated, experimental, or non-standard.

Continue to R.and()

Learn how to AND two values with Ramda R.and().

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