Pick by intent. Need the id/key → findKey; need the record → find.
Compatibility
Browser & Runtime Support
_.findKey ships with Underscore.js (1.x). It runs anywhere Underscore runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install underscore.
✓ Stable · Underscore 1.x
_.findKey()
Available in [email protected] (UMD / ESM). Works in evergreen browsers and current Node LTS when Underscore is loaded.
100%With Underscore 1.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.findKeyUnderscore 1.x+
Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]).
Frequently Asked Questions
_.findKey(object, predicate, [context]) returns the key of the first value for which the predicate is truthy. If nothing matches, it returns undefined.
_.find returns the matching value. _.findKey returns the matching key (property name). Both stop at the first success.
Each call gets (value, key, object). You can test the value, the key, or both.
undefined — same idea as _.find when no element passes.
Yes. A property name string or a matcher object works — Underscore builds the predicate via _.property or _.matcher.
No. It only reads properties and returns a key string (or undefined).