1const activities = [
2 { title: 'Hiking', date: new Date('2019-06-28') },
3 { title: 'Shopping', date: new Date('2019-06-10') },
4 { title: 'Trekking', date: new Date('2019-06-22') }
5]
6
1array.sort(function(o1,o2){
2 if (sort_o1_before_o2) return -1;
3 else if(sort_o1_after_o2) return 1;
4 else return 0;
5});