title: dynamically create two dimensional table with string indexes in javascript
body: <p>I need to parse a table to JSON, I found this solution and it works:</p>
  
  <pre><code>    var tab=[{"value":"1.0","label":"Alabama"},{"value":"2.0","label":"Alaska"},        {"value":"3.0","label":"American Samoa"}];
      var myJsonString = JSON.stringify(tab);  
      var jsonData = $.parseJSON(myJsonString);
  </code></pre>
  
  <p>The problem is when I declare dynamically the two dimensional table 'tab' it doesn't work:</p>
  
  <pre><code>    var tab_desc1= new Array(3);
      tab_desc1[0]=new Array(2);
      tab_desc1[0]["value"]="1.0";
      tab_desc1[0]["label"]="Alabama";
      tab_desc1[1]=new Array(2);
      tab_desc1[1]["value"]="2.0";
      tab_desc1[1]["label"]="Alaska";
      tab_desc1[2]=new Array(2);
      tab_desc1[2]["value"]="3.0";
      tab_desc1[2]["label"]="American Samoa";
      var myJsonString = JSON.stringify(tab_desc1);    
      var jsonData = $.parseJSON(myJsonString);
  </code></pre>
  
  <p>Logically my declaration contains error, bur I can't see it.
  Any help! Thanks. </p>