# Function reduce

- reduce<T, U>(iterable, f, initial): U

- The equivalent of Array.prototype.reduce for iterators.

  #### Type Parameters

  - T
  - U

  #### Parameters

  - iterable: Iterable<T, any, any>

    The iterator to reduce.

  - f: ((previous: U, current: T, index?: number) => U)

    The reducer function.

    - - (previous, current, index?): U

      - #### Parameters

        - previous: U
        - current: T
        - `Optional` index: number

        #### Returns U

  - initial: U

    The initial value to use for reduction.

  #### Returns U