Trying to get flattened data out of map()
<p>I'm currently trying to create an object to be used in a Json request, based on the controls on the page and their values.</p>

<p>I'm using the jquery <code>map()</code> fuction to get the keys and values out of the controls like so</p>

<pre><code>var data = $("fieldset &gt; div.section").map(function (i, e) {
    var result = {};
    result[e.children[0].id.substring(3);] = e.children[1].value;

    return result;
}).get();
</code></pre>

<p>This gets the data I'm after, but I end up with nested objects rather than an array, this looks like so</p>

<pre><code>[{"ClientId":"123456"},{"ClientIdType":"5"},{"City":"Brisbane"},{"Sex":"10"},{"PostCode":"4064"},{"State":"QLD"}]
</code></pre>

<p>But what I want is something like</p>

<pre><code>{"ClientId":"123456","ClientIdType":"5","City":"Brisbane","Sex":"10","PostCode":"4064","State":"QLD"}
</code></pre>

<p>Is there a way to do this in one go, or should I just iterate over the array again to flatten it?</p>
