rxjs sort by date code example
Example 1: array sort in angular 6
array.sort((a,b) => a.title.rendered.localeCompare(b.title.rendered));
Example 2: sort array by date
const sortedActivities = activities.sort((a, b) => b.date - a.date)
array.sort((a,b) => a.title.rendered.localeCompare(b.title.rendered));
const sortedActivities = activities.sort((a, b) => b.date - a.date)