the requirement is: if the name of the array is the same, compare which timestamp, is larger to retain which, and remove the smaller one. The array is as follows:
var arr = [
{name: "", timestamp: 1537243392},
{name: "", timestamp: 1537243369},
{name: "", timestamp: 1537243411},
{name: "", timestamp: 1537243241},
{name: "", timestamp: 1537243204},
];
the desired array result is:
var finalArr = [
{name: "", timestamp: 1537243392},
{name: "", timestamp: 1537243411},
{name: "", timestamp: 1537243241},
{name: "", timestamp: 1537243204},
];