let a=data let b=[1,2,3] for(let i = 0; i < a.length;i++){ for(let s = 0; s<b.length;s++){ if(a[i].id == b[s]){ a.splice(i,1) } } }