> 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/matchesproperty.md).

# \_.matchesProperty

**语法：**

```javascript
_.matchesProperty(path, srcValue)
```

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

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

**描述：**

创建一个深比较的方法来比较给定对象的`path`的值是否是`srcValue`。 如果是返回`true`，否则返回`false`。

> **注意:**&#x8FD9;个方法支持以[`_.isEqual`](https://lodash.com/docs/4.17.10#isEqual)的方式比较相同的值。

**开始版本：**&#x33;.2.0

**参数：**

* `path (Array|string)`: 给定对象的属性路径名。
* `srcValue (*)`: 要匹配的值。

**返回值：**

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

**例子：**

```javascript
var objects = [
  { 'a': 1, 'b': 2, 'c': 3 },
  { 'a': 4, 'b': 5, 'c': 6 }
];

_.find(objects, _.matchesProperty('a', 4));
// => { 'a': 4, 'b': 5, 'c': 6 }
```
