📜  基于对象属性javascript代码示例从对象数组中删除对象

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

代码示例1
var myArray = [
    {field: 'id', operator: 'eq', value: id}, 
    {field: 'cStatus', operator: 'eq', value: cStatus}, 
    {field: 'money', operator: 'eq', value: money}
];

// only keep objects in array where obj.field !== 'money'
myArray = myArray.filter(function( obj ) {
    return obj.field !== 'money';
});