Answer the question
In order to leave comments, you need to log in
How to understand how JavaScript object comparison works?
The comparison of objects is not entirely clear. Why d == d1 produces false is understandable. Different objects, different links. But in other cases, I can't figure it out. Tell me please.
var d= new Date();
var d1= new Date(d.getTime());
console.log(d>=d1); // true
console. log(d> d1); // false
console. log(d== d1); // false
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question