reduceRight()
Apply a reducer Function to each array element, from right to left, to get a single value.
Description
The reduceRight()
method applies a reducer Function to each
Array element, from right to left, by passing the reducer value
returned from the previous iteration and the next Array element
as parameters.The result of the last calculation is the value returned by
the method.
reduceRight()
starts with the last value in the array, passing the last
and second to last array values on the first call.
the calling array isn’t changed.
Examples
Reduce the Array elements, right to left:
"CBA"
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!