I have one array,
0: (4) ['0', '0', '1', '2']
1: (4) ['0', '0', '2', '2']
2: (4) ['0', '2', '2', '2']
Tried to get sum of row and col,
var rowSum = result.map(r => r.reduce((a, b) => a + b));
var colSum = result.reduce((a, b) => a.map((x, i) => x + b[i]));
but getting
row 0012,0022,0222
col 000,002,122,222