var a = [[1,2,3],[5,7,9]]; var b = []; var brindex=0; for(var i=0;i<a[0].length;i++){ for(var j=0;j<a.length;j++){ brindex+=a[j][i]; } b.push(brindex); brindex=0; } console.log(b);
var a = [[1,2,3],[5,7,9]]; var b = []; var brindex=0; for(var i=0;i<a[0].length;i++){ for(var j=0;j<a.length;j++){ brindex+=a[j][i]; } b.push(brindex); brindex=0; } console.log(b);