title: Merge duplicate array keys in a javascript array
body: <p>My Array :</p>
  
  <pre><code>{ { PID : [ '1' , '2' , '3' , ..] } , PID : [ '5' , '6' , '7' , '8' ....] , PID : .....} }
  </code></pre>
  
  <p>This one is a messy array and i would like to have my result combined and clean :</p>
  
  <p>Result :</p>
  
  <pre><code>{ {PID : [ '1' , '2' , '3' , .. , '5' , '6' , '7' and so on ] }}
  </code></pre>
  
  <p>My Code (PSEUDO):</p>
  
  <pre><code>var links = [];
  
  while( looping of a condition )
  {
  
  links.push( function(){
  
  var xArr = [];
  var yArr = [];
  $.each(function(){
  xArr.push(somevalue);
  yArr.push(somevalue);
  })
  
  return { PID : xArr , SKU : yArr  } );
  
  }
  </code></pre>
  
  <p>And this complex piece of code generated an array with multiple arrays under the duplicate keys 'PID'.</p>
  
  <p>What I've tried:</p>
  
  <p>1.Pushing xArr and yArr into zArr and returning that instead.</p>
  
  <p>I dont have much idea how to proceed , i agree that i am not much of an expert in javascript arrays as of yet . I just ask for a way to go about this issue , more or less a pseudo explanation .  </p>