CCC Docs
    Preparing search index...

    Similar to Array.reduce, but works on any iterable.

    The iterable to be reduced.

    A callback to be called for each value. If it returns null or undefined, the previous result will be kept.

    The initial value.

    The accumulated result.

    • Similar to Array.reduce, but works on any iterable.

      Type Parameters

      • T

      Parameters

      • values: Iterable<T>

        The iterable to be reduced.

      • accumulator: (a: T, b: T, i: number) => undefined | null | void | T

        A callback to be called for each value. If it returns null or undefined, the previous result will be kept.

      Returns T

      The accumulated result.

    • Similar to Array.reduce, but works on any iterable.

      Type Parameters

      • T
      • V

      Parameters

      • values: Iterable<V>

        The iterable to be reduced.

      • accumulator: (a: T, b: V, i: number) => undefined | null | void | T

        A callback to be called for each value. If it returns null or undefined, the previous result will be kept.

      • init: T

        The initial value.

      Returns T

      The accumulated result.