I an array of objects. Each object has a date property and a string property. I also have an empty array. I cant figure out the logic to push the string based on date oldest to newest .
const oldToNew = []
for (const baseId in results[key][test]) {
// log the array of objects
//example [{string: 'test', date: '2019-03-04T10:36:37.206000Z'}, {string: 'test1', date: '2019-03-010T10:36:37.206000Z'}]
console.log(results[key][test][baseId])
results[key][test][baseId].forEach(element => {
});
}
// I want the value to be [test, test1]