I want to remove specific elements in the original array (which is var a). I filter() that array and splice() returned new array. but
I know I'm a little bit late to the party, but how about a little bit different approach?
var a = [{name:'tc_001'}, {name:'tc_002'}, {name:'tc_002'}, {name:'tc_002'}, {name:'tc_003'}];
while ( a.findIndex(e => e.name === 'tc_002' ) >= 0 )
a.splice( a.findIndex(f => f.name === 'tc_002'),1);
console.log(a);
I know it has some drawbacks, but i hope, it will help some of you in some cases :)
cheers!