Array of Data
[
{group: 'a', tab: "1", name: 'input1'},
{group: 'b', tab: "1", name: 'input2'},
{group: 'b', tab: "1", name: 'input3'},
{group: 'c', tab: "2", name: 'input4'},
{group: 'a', tab: "1", name: 'input5'},
{group: 'c', tab: "2", name: 'input6'},
];
In my application, each element in the array (totaling over 50) represents an input that is part of a specific group (a, b, or c) and tab (1, 2, etc.). To achieve my goal, I aim to determine how many groups are associated with each tab by creating an object or array with this structure:
[
{tab1:{groups: ["a", "b"]}},
{tab2:{groups: ["c"]}},
]