Hey Masha!
for (j = 0; j< numbers[i].length;j++){
We iterate the whole sub-array using sub-array’s length property numbers[i].length
.
sum = sum + numbers[i][j]
We add each element of sub-array in each iteration. If we talk about the i=0
then in the first iteration, number[0][0] will be added. In second, number[0][1] will be added.In third, number[0][2] will be added. In fourth, number[0][3] will be added.
After four iterations, we will get out of the loop as for i=0 the numbers[i].length is four, and the sum
will have the sum of all elements of ith sub-array.
sums[i] = sum;
We store the calculated sum of all elements of ith sub-array on the ith position of a new array sums
that we have declared earlier.
sum = 0;
We reset the sum
variable to use it for the next ith iteration (the next sub-array).
Thank you for asking the question.