Sorting an Array by Date Value in JavaScript
Learn how to sort an array of items by date value in JavaScript. If you have an array of objects like the one below, which contains a set of date objects: const activities = [ { title: 'Hiking', date: new Date('2019-06-28') }, { title: 'Shopping', date: new Date('2019-06-10') }, { title: 'Trekking', date: new Date('2019-06-22') } ] and you want to sort those activities by the date property, you can use the sort() method of Array....