📜  typescript reduce 初始值类型 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:35.838000             🧑  作者: Mango

代码示例1
const { foo: I[], bar: U[] } = arr.reduce(
  ({ foo, bar }, current) => {
    // stuff...
    return { foo, bar };
  }, { foo: [], bar: [] } as { foo: I[], bar: U[] }
);