js 数组对象去重简写

210 阅读1分钟

const map = new Map(); const newArr = imgs.filter(v => !map.has(v.file_id) && map.set(v.file_id, 1));

js 数组对象去重简写