What is the best strategy for grouping an array of n objects based on n keys or nested keys in the most efficient manner?
const data = [,
{a: 1, b: 2, c:3},
{d: 4, e: 5, f: 6},
{a: 1, b: 2, c:3},
{g: 7, h: 8, i: 9},
{d: 4, e: 5, f: 6},
{g: 7, h: 8, i: 9},
];
transformed to
const grouped = [
[
{a: 1, b: 2, c:3},
{a: 1, b: 2, c:3},
],
[
{d: 4, e: 5, f: 6},
{d: 4, e: 5, f: 6},
],
[
{g: 7, h: 8, i: 9},
{g: 7, h: 8, i: 9},
],
]