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.