Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js remove object from array by value

let originalArray = [
    {name: 'John', age: 23, color: 'red'}, 
    {name: 'Ann', age: 21, color: 'blue'}, 
    {name: 'Mike', age: 13, color: 'green'}
];

let filteredArray = originalArray.filter(value => value.age > 18);
Source by javascriptf1.com #
 
PREVIOUS NEXT
Tagged: #js #remove #object #array
ADD COMMENT
Topic
Name
6+6 =