js两个二维数组合并并去除相同项(整理)

在这里插入图片描述

var arr0 = [...this.multipleSelection2, ...this.share2];
console.log(arr0, '374')
var arr1 = [];
var arr = [];
for (var i = 0; i < arr0.length; i++) {
    
    
	if(!arr1.includes(arr0[i].id)){
    
    
		arr1.push(arr0[i].id);
		arr.push(arr0[i])
	}
}
this.share2 = arr;

猜你喜欢

转载自blog.csdn.net/qq_38881495/article/details/125517458