@Phrogz answers are both great, but here is a great, more concise answer:
array.sort(function(a,b) { return a.getTime() - b.getTime() });
Using the arrow function way
array.sort((a,b)=>a => a.getTime() - b.getTime());
found here: Sort date in Javascript