There is:
[1, 2, 3, 0] [1, 2, 3,] [1, 2] We need the result in the form of a single array, where the indices will be the sum of the columns, i.e.
[3, 6, 6, 0] UPDATED: Answer:
var array = [ [1, 2, 3, 0], [1, 2, 3], [1, 2] ], result = array.reduce(function (r, a) { a.forEach(function (b, i) { r[i] = (r[i] || 0) + b; }); return r; }, []); ps @ Oleg Degtev kicked in the right direction =)