function zeroArray(m, n) { // Creates a 2-D array with m rows and n columns of zeroes let newArray = []; let row = []; for (let i = 0; i < m; i++) { // Adds the m-th row into newArray for (let j = 0; j < n; j++) { // Pushes n zeroes into the current row to create the columns row.push(0); console.log(row); } // Pushes the current row, which now has n zeroes in it, to the array newArray.push(row); } return newArray; } let matrix = zeroArray(3, 2); console.log(matrix);En este código, debo reinicializar la variable de fila en el bucle externo en una matriz vacía para crear una matriz 2D con filas y columnas que se vean así: [[0,0], [0,0], [0, 0]]. Sin reiniciar la variable, obtengo un resultado completamente diferente. Entiendo cómo funciona el código, pero no entiendo el impacto total de la reinicialización. ¿Por qué establecer la variable de fila nuevamente en una matriz vacía crearía una salida diferente?