简单题也不是那么简单。 right, down, left, up 用来记录每次循环到哪,每次都会进行一个改变;i, j 代表在原矩阵中的坐标;while 中的 if 用于判断终止。 function printMatrix(matrix) { // write code here let right = matrix[0].length - 1; let down = matrix.length - 1; let left = 0; let up = 1; let arr = [] let [i, j] = [0, 0]; // 考虑只有一行的情况 if (down == 0) { retu...