title: Merge two arrays into one javascript object
body: <p>I have an array of data. In <code>a</code> there are 10 fields and in <code>b</code> there are 10 fields</p>
  
  <pre><code>var a = [ "siddharth", "sid", "anything", "something", "nothing", ]
  var b = [ "23", "67", "10", "10", "90" ]
  </code></pre>
  
  <p>I am trying to create a <code>JSON</code> from these arrays as <code>a</code> as the key and <code>b</code>
  as values, as shown below:</p>
  
  <pre><code>{  "siddharth" : "23",  "sid" : "67" }
  </code></pre>
  
  <p>How can I achieve this using <code>javascript</code> or <code>jquery</code>. My current code is</p>
  
  <pre><code> var convert = '{'+datatest.columnHeaders[i].name +":"+datatest.rows[0][i]+'}';
           pair   = convert;/*JSON.stringify(convert);*/
           array.pairArray.push(pair);
  </code></pre>