Object.is() vs === | Dmitri Pavlutin

The Object.is() function is pretty much identical to the old "strict equality operator" (===), with two notable differences:

  1. NaN = NaN resolves to true (i.e. Object.is(NaN, NaN) // true);
  2. Negative zero = positive zero resolves to false (i.e. Object.is(-0, +0) // false).

Personally, I agree with 1) and not 2), so guess there still isn't an equality check which is intuitive to me 😂 Getting close though!

Explore Other Notes

Newer

Annotate the web

A neat little tool that can allow you to annotate a web page, comment on annotations, and then save/share/export that information. Spotted in an IndieWebCamp show-off session where one user has …

  • <!DOCTYPE html> <html> <head> <title></title> </head> <body> <p>The Object.is() function is pretty much identical to the old "strict equality operator" (===), with two notable …</p> </body> </html>
  • Murray Adcock.
Journal permalink