A helper that returns the first item in a list that passes a test. If no item passes, it returns undefined. It stops checking as soon as it finds a match, and it never changes the list. It has been part of Ramda List since v0.1.0 (stable, not deprecated, experimental, or non-standard).
Why not the native method? You have to call Array.prototype.find on the data. R.find(isAdmin) is curried and data-last, so it becomes a reusable lookup step for R.pipe.
Syntax
Call R.find. Start with this line.
Ramda
R.find(pred, list)
Call
What it does
R.find(pred, list)
Primary signature.
R.find(...)
Call the list helper.
Prefer import { find } from "ramda" when you want a named import.
Library declarations
Ramda
R.find(pred, list)
Parameters
Parameter
Description
pred
Required. value → Boolean. Truthy means "this is the one"
list
Required. An array (or string), or any object with its own find method
Return Value
Return Value
Description
*
The first passing item itself (not a copy), or undefined
Ramda Examples
Example 1 — Official Hit and Miss
Look for a: 2, then for a: 4, which is not in the list.
Curried step.R.find(R.endsWith(".pdf")) has its test but no list yet.
Pipe.R.pipe runs the lookup first, then passes its result to the next step.
Fallback.R.defaultTo("no pdf") replaces undefined (or null/NaN) and passes real values through.
Result. The first list has a PDF, so you get guide.pdf. The second has none, so you get no pdf.
Compatibility
Browser & Runtime Support
R.find is one of Ramda’s original List helpers, available since v0.1.0. It uses its own loop rather than the ES2015 Array.prototype.find, so it runs anywhere Ramda runs. In the browser, load it from a CDN or a bundler. In Node.js, Bun, or Deno, run npm install ramda.
✓ Stable · Ramda 0.1.0+
R.find()
Support depends on the Ramda version you load, not on a browser feature. Your own test must also be valid in that runtime. For example, arrow functions need an ES2015 engine.
100%Modern browsers & runtimes
Google ChromeModern versions · Desktop & Mobile
Full support
Mozilla FirefoxModern versions · Desktop & Mobile
Full support
Apple SafariModern versions · macOS & iOS
Full support
Microsoft EdgeChromium-based
Full support
OperaModern versions
Full support
Samsung InternetModern versions · Android
Full support
Android WebViewModern WebView
Full support
Internet ExplorerNot a target for current Ramda releases
Legacy
Node.jsMaintained LTS · npm install ramda
Supported
Bunimport from "ramda"
Supported
Denoimport from "npm:ramda"
Supported
R.findRamda 0.1.0+
Bottom line: Safe for production in any modern browser or JavaScript runtime once Ramda is loaded. The labs on this page use [email protected] from a CDN.
Frequently Asked Questions
R.find(pred, list) returns the first item for which pred returns a truthy value, or undefined if no item passes. It stops checking as soon as it finds a match. Docs sample: R.find(R.propEq(2, 'a'))([{a: 1}, {a: 2}, {a: 3}]) //=> {a: 2}.
Both return the first match or undefined. R.find is curried and data-last, so R.find(isAdmin) is a reusable function for R.pipe. Its predicate receives only the value, with no index or array argument.
R.find returns one item (or undefined) and stops at the first match. R.filter always returns a new array with every match. Use find for lookups and filter for subsets.
Wrap the result with R.defaultTo: R.defaultTo('none', R.find(pred, list)). In a pipeline: R.pipe(R.find(pred), R.defaultTo('none')).
A found item can be falsy, such as 0, an empty string, or false, so if (result) treats it as a miss. Compare with result !== undefined, or use R.findIndex and check for -1.
No. R.find has been part of Ramda since v0.1.0 and is stable. It is not deprecated, experimental, or non-standard.