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 […]
  • The Object.is() function is pretty much identical to the old "strict equality operator" (===), with two notable […]
  • Murray Adcock.
Journal permalink

Made By Me, But Made Possible By:

CMS:

Build: Gatsby

Deployment: GitHub

Hosting: Netlify

Connect With Me:

Twitter Twitter

Instagram Instragram

500px 500px

GitHub GitHub

Keep Up To Date:

All Posts RSS feed.

Articles RSS feed.

Journal RSS feed.

Notes RSS feed.