Сортировка по дате JS
array.sort((a,b) => new Date(b.date) - new Date(a.date));
Jealous Jellyfish
array.sort((a,b) => new Date(b.date) - new Date(a.date));
const sortedActivities = activities.sort((a, b) => b.date - a.date)
array.sort(function(a,b){return a.getTime() - b.getTime()});
array.sort(function(o1,o2){
if (sort_o1_before_o2) return -1;
else if(sort_o1_after_o2) return 1;
else return 0;
});