AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## eq + [link](./eq "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L9409 "View in source.") + [npm](https://www.npmjs.com/package/lodash.eq "See the npm package.") ``` _.eq(value, other) ``` 执行 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) 比较两者的值确定它们是否相等。 ### 参数 1. value (\*) 要比较的值 2. other (\*) 其他要比较的值 ### 返回值 (boolean) 相等返回 `true`,否则返回 `false` ### 示例 ``` var object = { 'user': 'fred' }; var other = { 'user': 'fred' }; _.eq(object, object); // => true _.eq(object, other); // => false _.eq('a', 'a'); // => true _.eq('a', Object('a')); // => false _.eq(NaN, NaN); // => true ```