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

# \_.eq（两值是否相等）

**语法：**

```javascript
_.eq(value, other)
```

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

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

**描述：**

执行[`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)比较两者的值，来确定它们是否相等。

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

**参数：**

* `value (*)`: 要比较的值。
* `other (*)`: 另一个要比较的值。

**返回值：**

* `(boolean)`: 如果两个值相等返回 true ，否则返回 false 。

**例子：**

```javascript
var object = { 'a': 1 };
var other = { 'a': 1 };

_.eq(object, object);
// => true

_.eq(object, other);
// => false

_.eq('a', 'a');
// => true

_.eq('a', Object('a'));
// => 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/eq.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.
