Q:

Why these two dates are not equal in javascript?

I'm comparing two dates in objA and objB, and they are not equal as the following console output shows.
Can't understand why..
objA[keysA[i]]
Sun Sep 25 2016 00:00:00 GMT+0900 (KST)
objB[keysA[i]]
Sun Sep 25 2016 00:00:00 GMT+0900 (KST)
typeof objA[keysA[i]]
"object"
typeof objB[keysA[i]]
"object"
objA[keysA[i]] !== objB[keysA[i]]
true

A:

In JavaScript you compare objects by reference.
let a = {};
let b = {};
let c = a;

a == b //false
a == c //true

A simple way of comparing objects is to convert them to a string and compare the string. You can use Date.prototype.toString to compare Date objects like this
objA[keysA[i]].toString() !== objB[keysA[i]]].toString() //false

