TypeScript Version: 3.5.1
Search Terms: reduce, es5.d.ts
Code
As currently defined in lib/lib.es5.d.ts:
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
It could be extended by
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U): U;
to work properly in the cases, when initialValue is not supplied and a value that results from a reduction has different type from reducing array elements.
TypeScript Version: 3.5.1
Search Terms: reduce, es5.d.ts
Code
As currently defined in lib/lib.es5.d.ts:
It could be extended by
to work properly in the cases, when initialValue is not supplied and a value that results from a reduction has different type from reducing array elements.