title: adding array to Object
body: <p>I am trying to loop through Json twice: once for parent elements and then again for more detail.  (This eventually will be exported to XML)  In the meantime, how do I go about adding an array to an Object?  My current code doesn't create XMLObjectDetail</p>
  
  <pre><code> XMLObject = {};
   var XMLObjectDetail = [];
  
   $.each(data, function(index, element) {
          XMLObject.CardCode = element['CardCode'] 
          XMLObject.CardName = element['CardName'];
          console.log(XMLObject);
  
    $.each(element, function(key, value) { 
         XMLObject[[XMLObjectDetail.InvPayAmnt]] = value['InvPayAmnt']; 
        });
    });
  </code></pre>