191
rated 0 times
[
193]
[
2]
/ answers: 1 / hits: 64066
/ 13 Years ago, thu, july 28, 2011, 12:00:00
I have two arrays of equal length, and I need to multiply the corresponding (by index) values in each, and sum the results.
For example
var arr1 = [2,3,4,5];
var arr2 = [4,3,3,1];
would result in 34 (4*2+3*3+4*3+5*1).
What's the simplest to read way to write this?
More From » arrays