title: JavaScript - Join two JSON strings (nested array)
body: <p>I have two JSON strings that are constructed dynamically.
  The first one is created from an XML Document:</p>
  
  <pre><code>if (window.DOMParser) {
          parser = new DOMParser();
          xmlDoc = parser.parseFromString(xml_string, "text/xml");
      } else// Internet Explorer
      {
          xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
          xmlDoc.async = false;
          xmlDoc.loadXML(xml_string);
      }
  var json_str = xml2json(xmlDoc,"")
  </code></pre>
  
  <p>The other one created on the spot from user input.</p>
  
  <p>Both have the same structure. The first one is:</p>
  
  <pre><code>{"Movies": { "Movie": [{"Title":"Movie1","Year":"2013"}]}};
  </code></pre>
  
  <p>and the second one is:</p>
  
  <pre><code>{"Movies": { "Movie": [{"Title":"Movie2","Year":"2014"}]}};
  </code></pre>
  
  <p>How can I concatenate these two so the result is two 'Movie' inside a "Movies": The result should be:</p>
  
  <pre><code>{"Movies": { "Movie": [{"Title":"Movie1","Year":"2013"},{"Title":"Movie2","Year":"2014"}]}};
  </code></pre>
  
  <p>I know that one method is to push <em>{"Title":"Movie2","Year":"2014"}</em> into <em>["Movies"]["Movie"]</em> ... but is there any other way?</p>