Answers for "typescript reduce initial value type"

0

typescript reduce initial value type

const { foo: I[], bar: U[] } = arr.reduce(
  ({ foo, bar }, current) => {
    // stuff...
	return { foo, bar };
  }, { foo: [], bar: [] } as { foo: I[], bar: U[] }
);
Posted by: Guest on April-19-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language