to repeat is already implemented, but you need to remove the old value, add the new value, not replace the old value.
for example: [{abure2MagneCREV 3}, {aVl3MagneCRAV 2}], now we need to add the value of {aburete 2cecece4}, where an is the judgment field, an is all 2, they repeat, and remove the first value of the array from it, and then push a new one.
Screenshot:
text code:
setData.push(str)
let obj = {};
setData = setData.reduce((cur,next) => {
obj[next.receiver] ? (cur[next.receiver] = next.receiver) : obj[next.receiver] = true && cur.push(next);
return cur;
},[]) //cur
console.log(setData)
The "obj [next.permission]?" code starts from? Then there is the repeated value, how to change it