Javascript – How to consolidate data in a recursive array
I am having array of items with following order: const arr = [ { group: { id: "group1", groupname: "groupname1" }, categories: [ { id: "cat1", categoryName: "category1", total: 5, available: 2, subCategories: [] }, { id: "cat2", categoryName: "category2",…