title: how do i group by continent in an array using JavaScript
body: <p>so what i want to do is group each set of countries by continent
  using array</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var countries = {
      "AF": "Afghanistan",
      "AX": "Åland Islands"
      "AL": "Albania",
      "DZ": "Algeria",
      "AS": "American Samoa",
      "AD": "Andorra",
      "AO": "Angola",
      "AI": "Anguilla",
      "AQ": "Antarctica",
      "AG": "Antigua and Barbuda",
      "AR": "Argentina",
      "AM": "Armenia",
      "AW": "Aruba",
  
  };</code></pre>
  </div>
  </div>
  </p>
  <p>i want to group by continent in an array using javascript then use conditional statement if selected country  is from europe {action} else if from asia{action}</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select&gt;
  &lt;option value=""&gt;Select Country&lt;/option&gt;
  
  &lt;option value="['Afghanistan','AF']"&gt;Afghanistan&lt;/option&gt;
  &lt;option value="['Åland Islands','AX']"&gt;Åland Islands&lt;/option&gt;
  &lt;option value="['Albania','AL']"&gt;Albania&lt;/option&gt;
  &lt;option value="['Algeria','DZ']"&gt;Algeria&lt;/option&gt;
  &lt;option value="['American Samoa','AS']"&gt;American Samoa&lt;/option&gt;
  &lt;option value="['Andorra','AD']"&gt;Andorra&lt;/option&gt;
  &lt;option value="['Angola','AO']"&gt;Angola&lt;/option&gt;
  &lt;option value="['Anguilla','AI']"&gt;Anguilla&lt;/option&gt;
  &lt;option value="['Antarctica','AQ']"&gt;Antarctica&lt;/option&gt;
  &lt;option value="['Antigua and Barbuda','AG']"&gt;Antigua and Barbuda&lt;/option&gt;
  &lt;option value="['Argentina','AR']"&gt;Argentina&lt;/option&gt;
  &lt;option value="['Armenia','AM']"&gt;Armenia&lt;/option&gt;
  &lt;option value="['Aruba','AW']"&gt;Aruba&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>