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

# \_.isMatch（是否匹配给定的值）

**语法：**

```javascript
_.isMatch(object, source)
```

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

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

**描述：**

执行一个深度比较，来确定`object`是否含有和`source`完全相等的属性值。

**注意:**&#x5F53;`source`为偏应用时，这种方法等价于[`_.matches`](https://lodash.com/docs/4.17.10#matches)。

> 参考：[偏函数与偏应用函数](https://blog.csdn.net/yuanguangyu1221/article/details/71307664)

偏应用比较匹配空数组和空对象`source`值分别针对任何数组或对象的价值。在[`_.isEqual`](https://lodash.com/docs/4.17.10#isEqual)中查看支持的值比较列表。

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

**参数：**

* `object (Object)`: 要检查的对象。
* `source (Object)`: 属性值相匹配的对象。

**返回值：**

* `(boolean)`: 如果object匹配，那么返回 true，否则返回 false。

**例子：**

```javascript
var object = { 'a': 1, 'b': 2 };

_.isMatch(object, { 'b': 2 });
// => true

_.isMatch(object, { 'b': 1 });
// => false
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lodash.shujuwajue.com/lang/ismatch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
