SCRIPTING NEWS
It's even worse than it appears.
-
+
Thursday December 27, 2018; 5:47 PM EST
Testing date equality in JS
#
Today I
learned
that testing two dates for equality in JavaScript does not work as a reasonable person might expect.
#
var d1 = new Date ("March 12, 1994");
#
var d2 = new Date ("March 12, 1994");
#
alert (d1 == d2);
#
The answer in the alert is false.
#
© 1994-2018
Dave Winer
.
Last update: Thursday December 27, 2018; 5:49 PM EST.