title: Merging two arrays with some logic in javascript
body: <p>I try to merge something like (I show it in json)</p>
  
  <pre><code>[["Field1","0"],["Field2","0"],["Field3","0"]]
  </code></pre>
  
  <p>with </p>
  
  <pre><code>{"0":{"Name":"Foo","Lastname":"Bar"}} 
  </code></pre>
  
  <p>when I do</p>
  
  <pre><code>$.extend({}, firstArray, secondArray);
  </code></pre>
  
  <p>I get in JSON</p>
  
  <pre><code>{
   "0":{"Name":"Foo","Lastname":"Bar"},
   "1":["Field1","0"],
   "2":["Field2","0"]
  } 
  </code></pre>
  
  <p>as you can see the first array is some kind of mixed with the second. I want it to be wrapped up like this</p>
  
  <pre><code>{
  "0":{"Name":"Foo","Lastname":"Bar"},
  "1":[ "1": ["Field1","0"],"2":["Field2","0"]]
  } 
  </code></pre>
  
  <p>So later when I consume it I can get the field stuff as one array. Is the possible? I cannot get it to work. Any ideas?</p>