const groupByRows = data.reduce((result, currentValue) => {
(result[currentValue.caseRows] = result[currentValue.caseRows] || []).push(
currentValue
);
return result;
}, {});
对已知数组按相同项进行重新分组
于 2023-06-14 13:42:36 首次发布
const groupByRows = data.reduce((result, currentValue) => {
(result[currentValue.caseRows] = result[currentValue.caseRows] || []).push(
currentValue
);
return result;
}, {});