i have an array structure like below from whch i need to delete all the entries having value vik
[{"type" :"x", value: "vik"},
{"type" :"x", value: "jack"},
{"type" :"x", value: "jack"},
{"type" :"x", value: "jack"},
{"type" :"x", value: "vik"},
{"type" :"x", value: "vik"},
]
iterating using for loop with splicing matching values vik screws up. what is the best way to do this.
my code is:
for(let obj of filterList){
var i =0
for(let lead of this.core.leadLocalList){
console.log("comapring:" + lead.campaign)
if(obj.value == lead.campaign){
console.log("matched")
this.core.leadLocalList.splice(i,1)
}else
i++
}
}