title: Jquery creating associative array with dynamic keys and multiple values
body: <p>Trying to create the following:</p>
  
  <blockquote>
    <p>array(   '12345' => 'A01', 'A02', 'A03'<br>
    '22222'  => 'B01',<br>
    '33333' => 'C01', 'C02')</p>
  </blockquote>
  
  <p>So basically each key is different generated dynamically from another array. Let's say variable numbers has '12345' after certain event is fired. </p>
  
  <p>We have an array called location, this one will have for example ('A01', 'A02', 'A03')</p>
  
  <p>So then on a master array it will map both numbers with the location. This is the array that i will need to save each time there is an event.</p>
  
  <p>The on the next event execution we shall get a new value on numbers variable such as '22222' and then a new array location will overwrite the other one with ('B01') for example and so on. </p>
  
  <p>Remember the keys are gonna be always dynamic and the values can be from 1 to 50 for example we don't know. I know this is more like Object Literals on Jquery. thx in advance.</p>
  
  <p>Here is the piece of code, need to be able to get the key and values</p>
  
  <pre><code>             $.each(dragarray, function(index, value) {
  
                      dragid_loc['value'] = [];
                      // do loop to add each element of other array
                      $.each(draglocation, function(index2, value2) {
                          dragid_loc.value.push(value2);
                      });
  
              });
  
              console.log(dragid_loc);
  </code></pre>
  
  <p>This line seems to cause the problem i won't push the values of another array draglocation into each. Need to get the key and the value.</p>
  
  <pre><code>dragid_loc.value.push(value2);
  </code></pre>