JavaScript Array reduce function takes a reducer function and an initial value. Using this function one can aggregate, transform items into a new list etc.
Example
Result
Read more
Array.prototype.reduce()
on Mozilla Developer Network.
See also
Array.prototype.reduceRight()
on Mozilla Developer Network.