title: Pushing values inside array using foreach
body: <p>Here's my input</p>
  
  <pre><code>var id = '1,2,3';
  var name = 'a,b,c';
  var value = 'x,y,z';
  </code></pre>
  
  <p>How can i construct a array like this</p>
  
  <pre><code>[
  {
  "id" : "1",
  "name" : "a",
  "value" : "x",
  }
  ,
  {
  "id" : "2",
  "name" : "b",
  "value" : "y",
  }
  ,
  {
  "id" : "3",
  "name" : "c",
  "value" : "z",
  }
  ]
  </code></pre>
  
  <p>I tried like this</p>
  
  <pre><code>var newArray = [];
  newArray.push({'id':id,'name':name,'value':value })
  </code></pre>
  
  <p>But it gives, a single array with comma seperated value. </p>
  
  <p>How can i do this Pls help</p>
  
  <p><strong>Note :</strong> I prefer only javascript </p>