First of all you need to declare another 2d array, lets say sum=[[],[],[]] to store the sum in. Then all you need to do is simply add the the two matrices.
C code:
for(i=0;i<r;++i)
for(j=0;j<c;++j)
{
sum[i][j]=a[i][j]+b[i][j];
}
I have actually never really coded much in Javascript but was able to put together a program on an online compiler I am getting NaN. But still works, and gives output.
var MatrixA = [[13,5,0],[11,6,4],[10,7,2],[9,8,0]];
var MatrixB = [[103,50,0],[11,60,40],[10,70,20],[90,80,0]];
var sum=[[],[],[],[]];
for (var i=0 ; i<MatrixA.length; i++ )
for (var j=0;j<MatrixB.length; j++)
{
sum[i][j]=MatrixA[i][j]+MatrixB[i][j];
}
for (var i=0 ; i<MatrixA.length; i++ )
for (var j=0;j<MatrixB.length; j++)
{
console.log(sum[i][j]);
}