Specification concepts

SameValueZero equality

Try the free JavaScript compiler

An abstract comparison that treats NaN as equal to NaN and both signed zeros as equal; objects still compare by identity. It is not a directly callable JavaScript function. Array includes demonstrates it.

Formal Syntax & Structure

javascript syntaxjavascript
SameValueZero(x, y) (specification notation)

Working Example

Example Snippetjavascript
console.log([NaN].includes(NaN),[0].includes(-0));
JavaScript Reference