Home > @i2analyze/notebook-sdk > data > IReadOnlyCollection > reduceRight
data.IReadOnlyCollection.reduceRight() method
Executes a reducer function on each object in the collection in right-to-left order.
Signature:
reduceRight<U>(callbackfn: (previousValue: U, currentValue: V, currentIndex: number) => U, initialValue: U): U;
Introduced: version 1.0
Type Parameters
Parameter | Type | Description |
---|---|---|
U | any | The type of the single object. |
Parameters
Parameter | Type | Description |
---|---|---|
callbackfn | (previousValue: U, currentValue: V, currentIndex: number) => U | A function to apply against an accumulator and each object in the collection. |
initialValue | U | The single object to return, in its initial state. |
Returns:
U
An object that represents the reduced collection.