CCC Docs
    Preparing search index...

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

    The value or 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: T | Iterable<T, any, any>

        The value or iterable to be reduced.

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

        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: V | Iterable<V, any, any>

        The value or iterable to be reduced.

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

        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.