Dotted key in a matcher object is a literal property name.
Nested object or [path, value] walks the real path.
Prefer nesting or the array shorthand for deep fields.
Compatibility
Browser & Runtime Support
_.findKey is a Lodash Object helper (since 1.1.0). It runs anywhere Lodash 4.x runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 1.1.0+
_.findKey()
Available in [email protected] full builds and the lodash/findKey modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.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
_.findKeyLodash 1.1.0+
Bottom line: Safe for production once Lodash is loaded. Prefer import findKey from "lodash/findKey". Use findLastKey when you need the last match.
Frequently Asked Questions
The first own enumerable string key whose value satisfies the predicate, or undefined when nothing matches.
(value, key, object). Value comes first — same shape as _.find — not (key, value).
Function; string property (truthy test); [path, value] matchesProperty pair; and a plain object used as a partial-deep matcher.
No. Nest the object ({ details: { isAdmin: true } }) or use ['details.isAdmin', true] with the array shorthand.
_.find returns the matched value; _.findKey returns the matched key. Same predicate rules.
Same behavior, opposite direction: findLastKey returns the last matching key.