Sum of all the items in the sub-array

This is my code so far

var arraySum = function(numbers) {
  var sums = [];
  var sum = 0;
  //write your code here 
  for(var i = 0; i < numbers.length; i++) {
    for(var j = 0; j < numbers[i].length; j++) {
      sum += numbers[i][j]
     } 
       sums.push(sum)
   } 
  return sums;
 } 

The expected output for arraySum([1,2,3,4], [5,6,7], [8,9,10,11,12]) is [10,18,50]. But my own output is 10,28,78

you have sum, its value is 0
then it becomes 1, 3, then 6 and 10
and 10 is pushed to sums
now the code keep summing, sum becomes 15, then 21 and then 28
and 28 is pushed to sums
etc

this is your issue

you can try to figure out yourself, or ask again
here an hint: to fix this you just need to move one line

Thank you. I moved the third line.