Creating a key/pair object using jQuery and some inputs
<p>I have a cart on my website and I need to let users easily change the quantity of items they have in their cart at a moment.</p>

<p>Here is the javascript code I have so far:</p>

<pre><code>&lt;script type="text/javascript" language="javascript"&gt;
    $(document).ready(function () {

        var items = [];

        $(".item").each(function () {
            var productKey = $(this).find("input[type='hidden']").val();
            var productQuantity = $(this).find("input[type='text']").val();
            items.addKey(productKey, productQuantity); ?
        });

        // 1. Grab the values of each ammount input and it's productId.

        // 2. Send this dictionary of key pairs to a JSON action method.

        // 3. If results are OK, reload this page.
    });
&lt;/script&gt;
</code></pre>

<p>The comments I wrote are just guidelines for me on how to proceed.</p>

<p>Is there a way to add a key/pair element to an array of sorts? I just need it to have a key and value. Nothing fancy.</p>

<p>I wrote in an <code>addKey()</code> method just for illustrative purposes to show what I want to accomplish.</p>
