var a = [1,2,3,4,5];
var b = [5,2];
a.forEach((itemA, indexA) => {
b.forEach(itemB => {
if (itemA === itemB) {
a.splice(indexA, 1, "deleteMe")
}
})
})
a= a.filter(item => item !== "deleteMe")
console.log("a: ",a);
Vue removes the same part of the two arrays
Guess you like
Origin blog.csdn.net/weixin_45729937/article/details/130178730
Ranking