Skip to main content

Equality · ==, === and Object.is

How do these three equality operations differ? Explain NaN and signed zero.

Official Reference

Model Answer & Explanation

== can convert operands before comparing. === does not coerce and compares objects by identity. Object.is treats NaN as equal to itself and distinguishes +0 from -0. === does the opposite for those two cases. Use strict equality by default unless you deliberately need other semantics.

Follow-up Interview Question · Why does NaN work as a key in a Map?

Module Context & References

JavaScript · Language theory Explain scope, closures, this, prototypes, equality and references
Personal Notes · Markdown

Technologies & Interview Topics Covered

Switch between short-term interview tracks and long-term 80/20 engineering depth to practice JavaScript internals, React rendering and hooks, timed frontend machine coding UI challenges, MeetaPro FG300, Blind 75 & NeetCode 150 DSA patterns, Python & FastAPI APIs, PostgreSQL query optimization & MVCC, Redis caching, Applied AI RAG pipelines & evaluations, and distributed system design.