I want to check my array for objects with matching values, if they match remove the object with the lowest index as that will be the one is "older"
I had success using this method for removing duplicate objects in the array, but when i get to specific values of those objects i'm not sure
someFunction() {
let cart = this.state.currentUser.cart
const newCartArray = cart.filter((light, index) => {
return index === cart.findIndex(obj => {
obj.use === light.use
})
})
cart = newCartArray
}