I want to remove specific elements in the original array (which is var a). I filter() that array and splice() returned new array. but
var a
filter()
splice()
You can assign filter array to a itself and then apply splice over it.
Example below:
var a = [{name:'tc_001'}, {name:'tc_002'}, {name:'tc_003'}] a = a.filter(function (e) { return e.name === 'tc_001'; }); a.splice(0,1);