title: How to create dynamic two dimensional array in jquery or js
body: <p>I need to create global two dimensional array in jquery or javascript</p>
  
  <p>My function is like this</p>
  
  <pre><code>&lt;script&gt;
  
  var globalArray[0] = new Array();
  
  function createArray(){
  
      alert(globalArray[0]);         
  }
  
  &lt;/script&gt;
  
  &lt;div&gt;&lt;input type='button' value='save' onclick='createArray();'&gt; &lt;/div&gt;
  </code></pre>
  
  <p>On click of that button I am getting this error <code>"globalArray[0] is undefined"</code></p>
  
  <p>How can I create global dynamic multi dimensional array.</p>