I can't seem to figure out how to filter my array by removing adjacent objects that have the same value of a specified property.
I want to remove adjacent objects with the same item, as the same one would come back eventually later on and I'd still want to have those recorded.
So this array for example...
[
{
item: "Car",
tstamp: 1609605221607
},
{
item: "Car",
tstamp: 1609605226605
},
{
item: "Truck",
tstamp: 1609605231610
},
{
item: "Car",
tstamp: 1609605236604
}
]
Would filter to this...
[
{
item: "Car",
tstamp: 1609605221607
},
{
item: "Truck",
tstamp: 1609605231610
},
{
item: "Car",
tstamp: 1609605236604
}
]
Removes car's object recorded at 1609605226605