Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove object from array of objects based on object property javascript

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';
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #object #array #objects #based #object #property #javascript
ADD COMMENT
Topic
Name
2+8 =