• Reduces collection to a value which is the accumulated result of running each element in collection thru iteratee, where each successive invocation is supplied the return value of the previous. If accumulator is not given, the first element of collection is used as the initial value.

    Contribution to minified bundle size, when it is the only function imported:

    • Lodash: 16,377 bytes
    • Micro-dash: 386 bytes

    Type Parameters

    • T extends readonly any[] | Nil

    Parameters

    • array: T
    • iteratee: ((accumulator, value, index) => NonNullable<T>[number])
        • (accumulator, value, index): NonNullable<T>[number]
        • Parameters

          • accumulator: NonNullable<T>[number]
          • value: NonNullable<T>[number]
          • index: number

          Returns NonNullable<T>[number]

    Returns IfCouldBe<T, Nil, undefined> | NonNullable<T>[number]

  • Type Parameters

    • E
    • A

    Parameters

    • array: Nil | readonly E[]
    • iteratee: ((accumulator, value, index) => A)
        • (accumulator, value, index): A
        • Parameters

          • accumulator: A
          • value: E
          • index: number

          Returns A

    • accumulator: A

    Returns A

  • Type Parameters

    • T

    Parameters

    • object: T
    • iteratee: ((accumulator, value, key) => NonNullable<T>[keyof NonNullable<T>])
        • (accumulator, value, key): NonNullable<T>[keyof NonNullable<T>]
        • Parameters

          • accumulator: NonNullable<T>[keyof NonNullable<T>]
          • value: NonNullable<T>[keyof NonNullable<T>]
          • key: keyof NonNullable<T>

          Returns NonNullable<T>[keyof NonNullable<T>]

    Returns IfCouldBe<T, Nil, undefined> | NonNullable<T>[keyof NonNullable<T>]

  • Type Parameters

    • T
    • A

    Parameters

    • object: T
    • iteratee: ((accumulator, value, key) => A)
        • (accumulator, value, key): A
        • Parameters

          • accumulator: A
          • value: NonNullable<T>[keyof NonNullable<T>]
          • key: keyof NonNullable<T>

          Returns A

    • accumulator: A

    Returns A