Home > Mobile >  How to filter object within an array that matches search object in Javascript
How to filter object within an array that matches search object in Javascript

Time:04-27

I am trying to filter and remove objects that are inside of my array however more objects are getting removed than I am hoping to target

const people = [
  {name: 'Adam', age: 30, country: 'USA'},
  {name: 'Carl', age: 30, country: 'UK'},
  {name: 'Bob', age: 40, country: 'China'},
 ];

const results = people.filter(element => {
  //            
  • Related