Typscript reduzieren Anfangswerttyp
const { foo: I[], bar: U[] } = arr.reduce(
({ foo, bar }, current) => {
// stuff...
return { foo, bar };
}, { foo: [], bar: [] } as { foo: I[], bar: U[] }
);
Adam Grepper