title: Merge JSON Object arrays and sort with Javascript
body: <p>I have a JSON object with 12 arrays. Different regions of countries. I'm trying to merge this array into select dropdown menu. The JSON looks like this:</p>
  
  <pre><code>"latinamerica": [
          "Argentina",
          "Bolivia",
          "Brazil",
          "Chile",
          "Colombia",
          "Ecuador",
          "Paraguay",
          "Peru"
      ],
      "korea": ["South Korea"]
  </code></pre>
  
  <p>Then I call in the JSON with:</p>
  
  <pre><code>    $.getJSON('js/countries.json', function(data) {
  
    var items = [];      
  
    items[0] = '&lt;option value="0"&gt;Country&lt;/option&gt;';
  
    $.each(data['latinamerica'], function(key, val) {
      items.push('&lt;option value="'+ key +'"&gt;'+ val +'&lt;/option&gt;');
    });
  });
  </code></pre>
  
  <p>Doing this for every array in the Object. Problem is I want to merge all these arrays, sort them alphabetically but still maintain what region they are associated with. So essentially I would have a dropdown of all the countries and the HTML would look like:</p>
  
  <pre><code>&lt;option value="latinamerica"&gt;Argentina&lt;/option&gt;
  &lt;option value="europe"&gt;Austria&lt;/option&gt;
  </code></pre>
  
  <p>I've tried doing concat but then I lose my array names. Suggestions? TIA.</p>