📌  相关文章
📜  如何从数组中删除特定对象 javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:26.740000             🧑  作者: Mango

代码示例6
var arr = [{id:1,name:'serdar'}, {id:2,name:'alfalfa'},{id:3,name:'joe'}];
removeByAttr(arr, 'id', 1);   
// [{id:2,name:'alfalfa'}, {id:3,name:'joe'}]

removeByAttr(arr, 'name', 'joe');
// [{id:2,name:'alfalfa'}]