我想知道如何改变这个
var array = [
{group: 'one', ...},
{group: 'one', ...},
{group: 'two', ...},
{group: 'two', ...},
{group: 'three', ...},
{group: 'three', ...},
];
对此
[
[{group: 'one', ...}, {group: 'one', ...}],
[{group: 'two', ...}, {group: 'two', ...}],
[{group: 'three', ...}, {group: 'three', ...}],
]
具有相同组的每个对象应位于同一数组中。
谢谢。