Creating an array of arrays filled with 'false'

I am trying to create an array of arrays which are all filled with false in JavaScript. However, I keep getting this error:

Uncaught TypeError: Cannot read property 'push' of undefined

My current code is this:

var fieldFilled = [];

for (var i = 0; i < 10; i++) {
    for (var j = 0; j < 10; j++) {

I don’t understand this error because it seems like fieldFilled is defined.

Thank you for your help.

38 thoughts on “Creating an array of arrays filled with 'false'”

Leave a Comment