I have an array that contains two different kinds of objects, each with their own date field in which the key is different. See below:
const array = [
{ id: 1, occurs_at: '2017-02-03T07:00:01.000Z' },
{ id: 2, occurs_at: '2017-02-03T10:00:01.000Z' },
{ id: 3, start: '2017-02-03T04:00:01.000Z' },
{ id: 4, start: '2017-02-03T06:00:01.000Z' },
];
I'm trying to get them in ascending order, but I can't seem to find the solution. I've been using Lodash for other sorting based on a single property. Any thoughts?