arr = [ {id:1,name:'aaa'}, {id:2,name:'bbb'}, {id:3,name:'ccc'}];for(var item in arr){ if(arr.hasOwnProperty(item)){ if(arr[item].id === 2){ delete(arr[item]); continue; } }}这样删除对象后会留有一个undefined占位符,请问如何彻底删掉相应的对象?
添加回答
举报
0/150
提交
取消