The Object.is() method determines whether two values are equal or not. It is similar to the === operator but there are some special cases for the Object.is() method. Here is an example that demonstrates special cases:
console.log(Object.is(0, -0));console.log(0 === -0);console.log(Object.is(NaN, 0/0));console.log(NaN === 0/0);console.log(Object.is(NaN, NaN));console.log(NaN ===NaN);
The output is as follows:
falsetruetruefalsetruefalse
Here's a handy table you might want to look at for the differences between 0, ==, ===, and Object.is: