I tried a lot ,but I still can not understand why what I have done here is not working as an approach of this challenge .

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

newArray.push(row);//here everytime I push a new arr (row) to newArray array

for (let j = 0; j < n; j++) {

// Pushes n zeroes into the current row to create the columns

newArray[i].push(0); //here newArray[i]=newArray[0], and in the second time it is gonna be newArray[i]=newArray[1];

```
}
// Pushes the current row, which now has n zeroes in it, to the array
newArray.push(newArray[i]);//here I push the last newArray[i] that I have just pushed to it two 0's
// the resutl [Array(6), Array(6), Array(6), Array(6), Array(6), Array(6)]
```

}

return newArray;// here the resut is different I dont know why

}

let matrix = zeroArray(3, 2);

console.log(matrix);

By the way, I can solve the problem using another method but I wanted to follow what they said to me to do in the comments.

I 'll apperciate any help ,thanks in advance.