I'm trying to understand why Array.prototype.sort() doesn't work for date objects:
var x = [new Date("2015-03-16"), new Date("2015-02-24"), new Date("2015-03-13")];
x.sort(); // [Fri Mar 13 2015 01:00:00 GMT+0100 (CET), Mon Mar 16 2015 01:00:00 GMT+0100 (CET), Tue Feb 24 2015 01:00:00 GMT+0100 (CET)]
x[0] <= x[1]; // true
x[1] <= x[2]; // false !!!!!!
I know how I can get them to sort nicely (by using x.sort(function (a, b) {return a - b; });, however I'd like to understand why {both Chrome and Safari} don't sort elements in an array in the order it knows about (when using <)