> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/util/property.md).

# \_.property

**语法：**

```javascript
_.property(path)
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L15879)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.property)

**描述：**

创建一个返回给定对象的`path`的值的函数。

**开始版本：**&#x32;.4.0

**参数：**

* `path (Array|string)`: 要得到值的属性路径。

**返回值：**

* `(Function)`: 返回新的函数。

**例子：**

```javascript
var objects = [
  { 'a': { 'b': 2 } },
  { 'a': { 'b': 1 } }
];

_.map(objects, _.property('a.b'));
// => [2, 1]

_.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
// => [1, 2]
```
