📅  最后修改于: 2022-03-11 14:48:35.838000             🧑  作者: Mango
const { foo: I[], bar: U[] } = arr.reduce(
({ foo, bar }, current) => {
// stuff...
return { foo, bar };
}, { foo: [], bar: [] } as { foo: I[], bar: U[] }
);