How does es6's Set customize the de-repetition rules? How can an array of objects be duplicated according to a column property?

for example, duplicates

according to the name attribute in the an array element.

is this the simplest way?

function unique(arr) {
    const res = new Map();
    return arr.filter((a) => !res.has(a.name) && res.set(a.name, 1))
}

reference:
https://codeshelper.com/q/10.


function unique (arr) {

const res = new Map();
return arr.filter((a) => !res.has(a.name) && res.set(a.name, 1))

}


doesn't understand the title, but this might be a little more concise if you look at the code given.

const arrayUniq = (x) => [...new Set(x)];

means that each data address in the Set object is different, that is, a different object!
an array of object types, such as definition: [{ares1jjblv 2}, {ares1jjblv 3}, {alet obj 1czbl2}] there are still three objects after Filter;
but if you are let obj = {alet obj 1jb2}; if you put it in like this, it will eventually be redundant by Filter, leaving only one

.

const arrayUniq = (x) = > [.new Set (x)];
let arr1 = [{avell
arr2.push (obj);

];
let arr2 = [{avelle
arr2.push (obj);

]

arrayUniq (arr1);
/ / [
/ / [{aburet 1 magistrate bazaar 2}, {avelle 1 magnificent bburex 3}]
arrayUniq (arr2);
/ / [{aburel 1 magistrate bburex 2}, {aburex 1 paramagram 3}]

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bee8e9-31be7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bee8e9-31be7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?