Suppose I have an array of objects like this :
let sampleArray = [
{
"id": 5,
"date": "2016-01-15T16:18:44.258843Z",
"status": "NEW",
"created_at": "2016-01-29T13:30:39.315000Z",
"updated_at": "2016-01-29T13:30:39.315000Z",
"request": 4
},
{
"id": 6,
"date": "2016-01-19T16:18:44.258843Z",
"status": "STD",
"created_at": "2016-01-29T13:30:39.372000Z",
"updated_at": "2016-01-29T13:30:39.372000Z",
"request": 4
},
{
"id": 7,
"date": "2016-01-23T16:18:44.258843Z",
"status": "FOR",
"created_at": "2016-01-29T13:30:39.417000Z",
"updated_at": "2016-01-29T13:30:39.417000Z",
"request": 4
}];
Can you suggest a way to filter this array so that only the object with the latest date
property is returned?