Takes an object and returns a function which will return the value of a provided property from that object — the inverse of _.property (official Underscore docs). Stable helper — not deprecated. Read-only; does not mutate the source.
Pass the required arguments shown below. Underscore object helpers usually return a new value — check whether the source object is mutated.
Syntax
Call _.propertyOf. Start with this line.
Underscore
_.propertyOf(object)
Call
What it does
_.propertyOf(object)
Primary signature.
_.propertyOf(...)
Call with the arguments your case needs.
Load Underscore with import _ from "underscore" (or the UMD CDN build) so these helpers are available as _.
Library declarations
Underscore
_.propertyOf(object)
Parameters
Parameter
Description
object
Required. Source fixed inside the returned function
Path arg
Optional. String key, or array of keys/indexes
Return Value
Return Value
Description
*
Function (path) → value
Underscore.js Examples
Example 1 — Official: Read name
Fix the object, then pass the key to the returned function.
Underscore
var stooge = {name: "moe"};
_.propertyOf(stooge)("name");
// → "moe"
propertyOf. Object first — best when one object, many keys.
property. Key first — best when many objects share one key — see _.property.
Same value. Both return "moe" here.
Pick. Choose based on which argument you reuse.
Compatibility
Browser & Runtime Support
_.propertyOf 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
_.propertyOf()
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
_.propertyOfUnderscore 1.x+
Bottom line: Safe for production once Underscore is on the page or in your bundle. Not a native browser API by itself — load Underscore first. Prefer a pinned CDN version (e.g. [email protected]).
Frequently Asked Questions
_.propertyOf(object) returns a function. Call that function with a key (or array path) and it returns the value from the fixed object. Official example: _.propertyOf({name: 'moe'})('name') returns 'moe'.
They are inverses. _.property(key) fixes the key and waits for an object. _.propertyOf(obj) fixes the object and waits for a key. Same value, opposite argument order.
Yes. Pass an array path to the returned function, e.g. lookup(['user', 'city']). A plain string is a shallow key.
Missing keys return undefined. A null/undefined object yields a safe accessor that returns undefined instead of throwing.
Use _.propertyOf when you will look up several keys on the same object. Use _.get for one immediate read, especially with a default fallback.
No. It is a stable Underscore object helper. Load Underscore 1.x and call _.propertyOf(object).