Takaro - v0.4.11
    Preparing search index...

    Function reduce

    • Reduces a collection to a value which is the accumulated result of running each element in the collection through the callback, where each successive callback execution consumes the return value of the previous execution. If accumulator is not provided the first element of the collection will be used as the initial accumulator value. The callback is invoked with four arguments: (accumulator, value, index|key, collection).

      Type Parameters

      • T
      • TResult

      Parameters

      • collection: T[] | null | undefined

        The collection to iterate over.

      • callback: MemoListIterator<T, TResult, T[]>

        The function called per iteration.

      • accumulator: TResult

        Initial value of the accumulator.

      Returns TResult

      Returns the accumulated value.

    • Type Parameters

      • T
      • TResult

      Parameters

      • collection: List<T> | null | undefined
      • callback: MemoListIterator<T, TResult, List<T>>
      • accumulator: TResult

      Returns TResult

      _.reduce

    • Type Parameters

      • T extends object
      • TResult

      Parameters

      • collection: T | null | undefined
      • callback: MemoObjectIterator<T[keyof T], TResult, T>
      • accumulator: TResult

      Returns TResult

      _.reduce

    • Type Parameters

      • T

      Parameters

      • collection: T[] | null | undefined
      • callback: MemoListIterator<T, T, T[]>

      Returns T | undefined

      _.reduce

    • Type Parameters

      • T

      Parameters

      • collection: List<T> | null | undefined
      • callback: MemoListIterator<T, T, List<T>>

      Returns T | undefined

      _.reduce

    • Type Parameters

      • T extends object

      Parameters

      • collection: T | null | undefined
      • callback: MemoObjectIterator<T[keyof T], T[keyof T], T>

      Returns T[keyof T] | undefined

      _.reduce