数组排序,去重,并提取出name,一句话完成

50 阅读1分钟

var uniqueNames = Array.from(new Set(arr.map(item => item.name)));