Skip to content
Advertisement

How to filter an array of object inside an array of objects based on an array and also remove properties of that object?

JavaScript

Result I wanted

JavaScript

I know i can filter the array with this code

JavaScript

But is there a way to remove the objects as well.

Advertisement

Answer

We can reduce to avoid multiple steps

This reduce filters and deletes part of the details array

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement