Invokes the method at path of object and returns the result. Part of Lodash Object (stable — not deprecated). Extra arguments after path are forwarded to the method. For the same call across a collection, use _.invokeMap.
Pass the object and path or keys shown below. Check whether the helper mutates or returns a new object.
Syntax
Call _.invoke. Start with this line.
Lodash
_.invoke(object, path, ...args)
Call
What it does
_.invoke(object, path, ...args)
Primary signature.
_.invoke(object)
Work with an object’s keys, values, or paths.
Prefer import invoke from "lodash/invoke" when you want a smaller bundle.
invokeMap. Same method on each collection element.
When. Deep path on one object → invoke.
When. Batch calls → invokeMap.
Compatibility
Browser & Runtime Support
_.invoke is a Lodash Object helper available in 4.x. It runs anywhere Lodash runs — modern browsers (via CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native equivalents resolve a path then call the function with the correct parent as this.
✓ Stable · Lodash 4.x
_.invoke()
Available in [email protected] full builds and the lodash/invoke 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
_.invokeLodash 4.x
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import invoke from "lodash/invoke" for smaller builds. Use invokeMap for collection-wide calls.
Frequently Asked Questions
_.invoke(object, path, ...args) invokes the method at path of object and returns the result. Official: _.invoke(object, 'a[0].b.c.slice', 1, 3) → [2, 3].
_.invoke calls one method on one object. _.invokeMap calls the same method on every element of a collection.
Like a normal method call, this is the parent of the method along the path — for example user.profile.toJSON runs with this === user.profile.
A missing method path returns undefined. If the path exists but is not a function, calling it can throw a TypeError — guard dynamic paths when needed.
Yes. String paths like 'a[0].b.c.slice' and array paths like ['a', 0, 'b', 'c', 'slice'] both work.
Use import invoke from "lodash/invoke" or require("lodash/invoke") so bundlers can tree-shake. Full build: import _ from "lodash" then _.invoke.