多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## 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 ```