Returns a function that will itself return the key property of any passed-in object. path may be a simple key, or an array of keys/indexes for deep fetching (official Underscore docs). Stable helper — not deprecated.
Pass the required arguments shown below. Underscore object helpers usually return a new value — check whether the source object is mutated.
Syntax
Call _.property. Start with this line.
Underscore
_.property(path)
Call
What it does
_.property(path)
Primary signature.
_.property(...)
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
_.property(path)
Parameters
Parameter
Description
path
Required. String key, or array of keys/indexes
Return Value
Return Value
Description
*
Function (object) → value
Underscore.js Examples
Example 1 — Official: Read name
Build an accessor for "name", then call it on an object.
Underscore
var stooge = {name: "moe"};
_.property("name")(stooge);
// → "moe"
property. Path first — best when many objects share one key.
propertyOf. Object first — best when one object, many keys — see _.propertyOf.
Same value. Both return "moe" here.
Pick. Choose based on which argument you reuse.
Compatibility
Browser & Runtime Support
_.property 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. Deep array paths are Underscore’s portable alternative to ad-hoc nested reads.
✓ Stable · Underscore 1.x
_.property()
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
_.propertyUnderscore 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
_.property(path) returns a function. Call that function with an object and it returns the value at path. Official example: _.property('name')({name: 'moe'}) returns 'moe'.
Pass an array path, e.g. _.property(['moe', 'hobbies', 1]). Underscore walks one segment at a time. A plain string is a shallow key.
The accessor returns undefined. For array paths, null/undefined midway stops safely without throwing.
Inverses. _.property(key) fixes the key and waits for an object. _.propertyOf(obj) fixes the object and waits for a key.
_.property returns a reusable function with no default. _.get(object, path, [default]) reads immediately and can supply a fallback.
No. It is a stable Underscore object helper and powers string iteratee shorthand in many collection methods. Load Underscore 1.x and call _.property(path).