matrixMax = (mat) => {
  let curMax = -Infinity;
  for (let i = 0; i < mat.length; i++) {
    for (let j = 0; j < mat[0].length; j++) {
      if (mat[i][j] > curMax) {
        curMax = mat[i][j];
      }
    }
  }
  return curMax;
}
Compute the maximum of a matrix.
@param {[[number]]} mat Matrix