Creates a function that invokes the method at path on a given object. Extra arguments are forwarded to that method. Part of Lodash Util since 3.7.0 (stable — not deprecated).
Note: The path is fixed; the object is supplied later — ideal for _.map when every item exposes the same method.
Syntax
Call _.method. Start with this line.
Lodash
_.method(path, [args])
Call
What it does
_.method(path, [args])
Primary signature.
_.method(...)
Call the util helper.
Prefer import method from "lodash/method" when you want a smaller bundle.
Library declarations
Lodash
_.method(path, [args])
Parameters
Parameter
Description
path
Required. String or array path of the method to invoke
args
Optional. Arguments forwarded to the method
Return Value
Return Value
Description
*
Invoker (object) → result
Lodash Examples
Example 1 — Official: Map with Dot Path
Invoke the same nested method on every object in a list.
method. Resolves the path and invokes it → numbers.
property. Resolves the path and returns it → functions.
Rule. Need a call? Use method. Need a getter? Use property.
Output note. The demo prints "function" for clarity in text.
Compatibility
Browser & Runtime Support
_.method is a Lodash Util helper since 3.7.0. It runs anywhere Lodash 3.7+ / 4.x runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 3.7.0+
_.method()
Available in [email protected] full builds and the lodash/method modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 3.7+
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
_.methodLodash 3.7.0+
Bottom line: Safe for production once Lodash is loaded. Prefer import method from "lodash/method" for smaller bundles. Pair with _.map when every item shares the same method path.
Frequently Asked Questions
_.method(path, …args) returns a function. Give that function an object and it invokes the method at path on that object, passing any args you bound when creating the invoker.
Extra arguments after path are bound when you call _.method—not when you call the returned function. Example: _.method('greet', 'Hi')(obj) calls obj.greet('Hi').
_.invoke(object, path, …args) runs once immediately. _.method(path, …args) returns a reusable invoker for many objects or for _.map.
_.method(path) fixes the path—the object comes later. _.methodOf(object) fixes the object—the path comes later.
Yes. That is the official pattern: _.map(objects, _.method('a.b')) calls the method at a.b on each item and collects the results.
If the path cannot be invoked, Lodash returns undefined (it does not throw). Guard critical paths or ensure every object exposes the method.