📌  相关文章
📜  获取唯一数组 javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:09.901000             🧑  作者: Mango

代码示例6
// one liner solution to get a unique array by object id
[{_id: 10},{_id: 20}, {_id: 20}].filter((item, i, ar) => ar.findIndex(each => each._id === item._id) === i)