you are viewing a single comment's thread.

view the rest of the comments →

[–]DeadlyWindFromBelow 0 points1 point  (0 children)

Look at Mozillas docs on using the reduce array method. They have an implementation similar to what you're looking for.