Date

“Lang” Methods

_.eq(value, other)

source npm package

Performs a SameValueZero comparison between two values to determine if they are equivalent.

引入版本

4.0.0

参数
value (*) : The value to compare.
other (*) : The other value to compare.

返回值
(boolean) : Returns true if the values are equivalent, else false.

示例
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
 
_.eq(NaN, NaN);
// => true