数组中对象去重只保留一条 const arr = [{ name:'张三', age:18 },{ name:'李四', age:20 },{ name:'张三', age:17 }] const newArr = Array.from( new Map(arr.map(obj => [obj.name, obj])).values() ); console.log(newArr)