We know what the difference between ==
and ===
is - basically, ===
prevents Javascript engine to convert one of the parameter for making both parameters of the same type. But now, in ES6, came a new operator - Object.is
which is a bit confusing (or maybe ===
is now confusing..)
From Mozila website (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness) we can see the difference:
Sameness Comparisons:
x y == === Object.is
+0 -0 true true false
NaN NaN false false true
So, for me, looks like Object.is
is even more strict in comparing parameters, if so, question raises - how unstrict was ===
(called "Strict Equality") :)