The opposite of _.property: creates a function that returns the value at a given path of a fixed object. Part of Lodash Util since 3.0.0 (stable — not deprecated).
Note: The object is fixed; the path is supplied later — ideal for _.map over a list of paths against one target.
Syntax
Call _.propertyOf. Start with this line.
Lodash
_.propertyOf(object)
Call
What it does
_.propertyOf(object)
Primary signature.
_.propertyOf(...)
Call the util helper.
Prefer import propertyOf from "lodash/propertyOf" when you want a smaller bundle.
Rule. Many paths / one object → propertyOf; many objects / one path → property.
Compatibility
Browser & Runtime Support
_.propertyOf is a Lodash Util helper since 3.0.0. It runs anywhere Lodash 3+ / 4.x runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 3.0.0+
_.propertyOf()
Available in [email protected] full builds and the lodash/propertyOf modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 3.0+
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
_.propertyOfLodash 3.0.0+
Bottom line: Safe for production once Lodash is loaded. Prefer import propertyOf from "lodash/propertyOf" for smaller bundles. Pair with _.map when you have many paths on one object.
Frequently Asked Questions
_.propertyOf(object) returns a function that takes a path and returns the value at that path on the fixed object. It is the opposite of _.property.
A path (string or array)—not the object. Example: _.propertyOf(object)('a[2]') reads object.a[2].
_.property(path) fixes the path—the object comes later. _.propertyOf(object) fixes the object—the path comes later.
_.get(object, path) reads once. _.propertyOf(object) returns a reusable path reader for many paths on the same object.
Yes. That is the official pattern: _.map(['a[2]', 'c[0]'], _.propertyOf(object)) reads each path from one object.
The accessor returns undefined. It does not throw. Use _.get(object, path, defaultValue) when you need a fallback in one call.