Skip to content
JavaScript·Intermediate·Conceptual·1 min read

Why do == and === both return false when comparing two different arrays with identical contents?

Short interview answer

Neither operator performs structural comparison for objects or arrays — both compare object references, so two distinct array instances are never equal to each other regardless of operator, even with identical contents.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Equality and type coercion

Related questions