let arr = ['q', 'w', 'e', 'r', 't', 'y']; let aaa = ['q', 'y']; arr = arr.filter(item => !aaa.some(aaaItem => aaaItem === item)); console.log(arr) //["w", "e", "r", "t"]
let a = [{name:'gaojiarui',age:'18',id:'1231'},{name:'gjr',age:'16',id:'1324'},{namg:'gqjr',age:'17',id:'1234'}]; let b = [{name:'gjr',id:'1324'},{name:'gqjr',id:'1234'}] a = a.filter(item => !b.some(aa => aa.id === item.id)) console.log(a); //[{name: "gaojiarui", age: "18", id: "1231"}]