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

Why does comparing two different Date objects with the same timestamp using === return false?

Short interview answer

Date objects are objects, so === compares references, not their internal time value; two distinct Date instances are never === to each other even representing the identical moment — use .getTime() to compare their values instead.

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