Mapping arrays of objects conditionally in Javascript
I have array of objects with a multi-level nesting. const switches = [{ orgId: "1111a7cd-0d58-11ef-83a2-06a19a0b1f5d", orgName: "Management 1", orgType: 2, organisations: [], features: [{ name: "AdvancedAdminApprovalLevels", type: "feature", category: "Management Features", value: false, }, { name: "AdminCategoryApprovalByRole", type: "feature", category:…