Have a large list of array data of which can exceed to N number.
Need to sort the array elements with latest date and time.

let array = [{"name": "Apple","modified_date": "2020-08-26 02:03:23.756"},
{"name": "Orange","modified_date": "2020-08-26 03:03:23.756"},
{"name": "Grapes","modified_date": "2020-08-26 04:03:23.756"}................N number length]
able to sort using small size of array
let sort = array.sort(function(a, b) {
return (new Date(b.modified_date)).getTime() - (new Date(a.modified_date)).getTime();
});
But with large length array correct sorting is not happening.What could be the issue!!!!?
Date()object. String compare should give you the same result here.