diagonal entries of a matrix in math.js code example Example: diagonal javascript matrix for (let j = 0; j < array[i].length; j++)