// 普通数组去重
let arr = [1,2,3,4,2,3,1,4,5,6,6,7]
// 复杂数组去重(删除字段x值重复的)
let arr = [{ ‘x‘: 1 }, { ‘x‘: 2 }, { ‘x‘: 1 }]
// 1.使用lodash文档(网址: https://www.lodashjs.com/docs/lodash.uniqBy)
_.uniqBy([{ ‘x‘: 1 }, { ‘x‘: 2 }, { ‘x‘: 1 }], ‘x‘);
前端小白自身一些的总结,如有需要仅供参考,如有问题欢迎评论,共同学习
原文:https://www.cnblogs.com/zw100655/p/15096877.html