0
i'd like to get a solution for this question ::Write a function called sumArrays that takes an array of arrays as a parameter,
function sumArrays(array){ var sum=0; for (let i = 0; i < array.length; i++) { sum=sum+array[i]; } return sum; }
2 odpowiedzi
+ 1
A structure of an array of arrays looks something like this.
[ [1, 2, 3],
[11, 12, 13, 14],
[21, 22, 23, 24, 25],
]
If you want to get a total of all the arrays (171), you need a nested loop to iterate over all the arrays.
The outer loop is for the individual array, and the inner loop is for the elements inside that individual array.
0
okay tysm for help