Is there a better way to do partial sums of array items in JavaScript? Is there a better way to do partial sums of array items in JavaScript? arrays arrays