Array.prototype.reduce
foldl