How to create a 2d array of zeroes in javascript?

Is there an easy way to programmatically create a 2d array in javascript?

What I don’t want:

var array2D = [ 
  [0,0,0],
  [0,0,0],
  [0,0,0]
]

19 thoughts on “How to create a 2d array of zeroes in javascript?”

  1. 940636 453921Hi there! This is my first comment here so I just wanted to give a quick shout out and tell you I really enjoy reading through your posts. Can you suggest any other blogs/websites/forums that deal with the same subjects? Thanks for your time! 63581

    Reply

Leave a Comment