Filter array of objects based on another array in javascript

The simplest way to filter is to use the array’s filter() function, similar to this:

people.filter(person => id_filter.includes(person.id))

Leave a Comment