getting values for a multidimensional array from users in C programming, we can use two for loops and scanf to get values.When I tried that in similar way in node javascript attempt was failed

I have tried something like this:

```
var readlineSync = require('readline-sync')
var arr = new Array();

console.log('enter aray values');

for (let i = 0; i < 6; i++){
    for (let j = 0; j < 6; j++){

 arr[i][j] = readlineSync.questionInt('')

 }

}

console.log(arr);

```

and I got an error saying :

```
arr[i][j] = readlineSync.questionInt('')
                  ^
TypeError: Cannot set properties of undefined (setting '0')

```