Function reduceRight

  • This function is like _.reduce except that it iterates over elements of collection from right to left.

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

    • Lodash: 16,375 bytes
    • Micro-dash: 382 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