how to create javascript array contain key and value?
<p>there is few text boxes im generating dynamically with a counter so its looks like this</p>

<pre><code>form.append('Street: &lt;input type="text" id="street'+counter+'" /&gt; city: &lt;input type="text" id="city'+counter+'" /&gt;&lt;br/&gt;'); 
counter++;
</code></pre>

<p>then im doing this to make a array</p>

<pre><code>var array = [];
for(i=1; i&lt;counter; i++){
array.push({'a':$('#street' + i).val(),'b':$('#city' + i).val()});          
}   
console.log(array);
$.ajax({
  type: "POST",
  url: "dummy.php",
  data: array,
  success: function(response, textStatus, xhr) {
  },
  error: function(xhr, textStatus, errorThrown) {
  }
});
</code></pre>

<p>but the problem is when im trying to send array to php script via ajax im getting 
Parameters
undefined undefined
undefined undefined</p>

<p>in post section of firebug</p>

<p>what im doing wrong here?</p>

<p>firebug console looks like with console.log(array) <img src="http://i.stack.imgur.com/S61C1.jpg" alt="firebug output"></p>

<p>Regards</p>

<p><strong>Seems like i found the solution 
i sent data like 
    data: {Addresses:array},
and it works</strong></p>
