Performs a SameValueZero comparison between two values to determine if they are equivalent.
SameValueZero
5.5.0
const object = { 'a': 1 }const other = { 'a': 1 }eq(object, object)// => trueeq(object, other)// => falseeq('a', 'a')// => trueeq('a', Object('a'))// => falseeq(NaN, NaN)// => true Copy
const object = { 'a': 1 }const other = { 'a': 1 }eq(object, object)// => trueeq(object, other)// => falseeq('a', 'a')// => trueeq('a', Object('a'))// => falseeq(NaN, NaN)// => true
The value to compare.
The other value to compare.
Returns true if the values are equivalent, else false.
true
false
Performs a
SameValueZero
comparison between two values to determine if they are equivalent.Since
5.5.0
Example