Skip to content

Tag: filtering

Filter array of infinitely nested objects

Let’s say I have an array of nested objects such as: And I would like to return a new array with id: 3 excluded for example. So it would become: The excluded id can be from any level, and it and its children should be removed. What’s the best approach to do this? I’ve tried several other sol…

Filtering arrays in JS/React

So here I have search functionality. Everything works fine except when an Item has not been found in the array. I have tried something with objects.Keys but it is displaying it on the render not when the Book has not been found like it should. Should I use if statement or. Answer You’re filtering the ca…