title: javascript multidimensional array problems
body: <p>I've been having problems creating an multidimensional array in javascript
  I have 2 arrays generated with PHP from a db.
  I want to create an array with the ID from ug_v_id &amp; assign keys with mixed values</p>
  
  <p>The error occurs when I get to 'ug_arr[ug_v_id]['id'] = ug_v_id;' it says "Uncaught TypeError: Cannot set property 'id' of undefined"</p>
  
  <pre><code>var ug_view_arr = [1, 2]; //from db
  var ug_list_arr = {"1":{"id":"1","company_id":"1","title":"test","type":"staff"}}; //from db
  var ug_arr = new Array();
  
  if(ug_view_arr_len&gt;0){
      for (i=0; i&lt;ug_view_arr_len; i++) {
          ug_v_id = ug_view_arr[i];
          ug_arr[i] = new Array(ug_view_arr_len);
          ug_arr[ug_v_id]['id'] = ug_v_id;
          ug_arr[ug_v_id]['name'] = ug_list_arr[ug_v_id]['title'];
          ug_arr[ug_v_id]['uType'] = ug_list_arr[ug_v_id]['type'];
          ug_arr[ug_v_id]['pType'] = 'Usergroup';
          ug_arr[ug_v_id]['view'] = true;
          ug_arr[ug_v_id]['edit'] = false;    
      }
  }
  </code></pre>
  
  <p>Any help would much be appreciated</p>