jquery each into js object
<p>im trying to create a final object with data in it, all of the elements are numbers except for one of them, and that one is to hold more objects. here is what i have so far.</p>

<pre><code>var data = '';
$(".item-element").each(function(e) {
    var id  = this.id;
    var qty = parseInt($("#" + this.id + " .element-qty").text());

});

var sale_data = {
                 "id"     : $('#sales_id').val(),
                 "cid"    : $('#sales_custom').val(),
                 "status" : $('#sales_status').val(),
                 "data"   : {
                             "services" : service_data,
                             "products" : product_data
                            },
                 "total"  : Number($('#sale-total').text().substr(1)),
                };
</code></pre>

<p>im trying to get product_data to hold the following type structure from the values of the id and qty in the each loop. the final data entry to look like this based on the each loop.</p>

<pre><code>                 "data"   : {
                             "services" : service_data,
                             "products" : {
                                            {id:qty},
                                            {id:qty},
                                            {id:qty}
                                          }
                            },
</code></pre>
