Javascript – How to remove all items with a particular ID and its associated items? Then its associated items and its subsequent items (recursion?)
I am having some difficulties in what the best way to go about this is. Example below: const arr = [{ parentId: 1, children: [ { childId: 11 }, { childId: 21 }, { childId: 31 }, ] }, {…