js sort objects array by datetime property using moment code example
Example 1: javascript order array by date
const sortedActivities = activities.sort((a, b) => b.date - a.date)
Example 2: array map order by timestamp reactjs
const sortedActivities = activities.slice().sort((a, b) => b.date - a.date)