Returns the result of applying the reducer function to each element of the source.
Type of items in the source.
Type of the result.
Reducer function to apply to each element.
Initial value or factory function to use as the first argument to the reducer function.
Collector that returns the result of applying the reducer function to each element of the source.
const result = reduce<number, number>((prev, curr) => prev + curr, 0)([1, 2, 3]);console.log(result); // 6 Copy
const result = reduce<number, number>((prev, curr) => prev + curr, 0)([1, 2, 3]);console.log(result); // 6
Returns the result of applying the reducer function to each element of the source.