title: create a grid array in JavaScript
body: <p>I want to setup a grid containing <strong>m * n</strong> objects. This grid got a width of <strong>m</strong> rows and <strong>n</strong> columns.</p>
  
  <p>I tried this code first</p>
  
  <pre><code>let map = [][]; // Create an array that takes a x and y index
  
  function createMap() {
      for (let x = 0; x &lt; columnCount; x++) {
          for (let y = 0; y &lt; rowCount; y++) {
              addCell(x, y); 
          }
      }
  }
  
  function addCell(x, y) {
      map[x][y] = cell(); // create a new object on x and y
  }
  </code></pre>
  
  <p>Obviously this is a wrong syntax. The initialization of map is wrong. How can I create the array that I can access a object by passing in the x and y coordinate to the array?</p>
  
  <p>Let's say I want to access the object on (3|7) I want to go for <code>map[3][7]</code>.</p>
  
  <p>Is that possible?</p>