title: How to iterate through a specific key-value pair in array
body: <p>I am working with a JSON object that consists of 250+ arrays (data related to different countries like population, language, currency etc.) I need a particular key-value pair (country code) to be pulled out of each array and stored in a different variable so I could use it for something else later.</p>
  
  <p>I have tried using forEach method but I don't have a lot of experience with it so I haven't succeeded. After googling similar questions I found that people are usually asking how to iterate though all key/value pairs and not a specific one like in this case.</p>
  
  <pre><code>$.getJSON("https://restcountries.eu/rest/v2/all", function(callback) { 
      var isoCode = callback[5].alpha2Code;
      console.log(isoCode);
  });
  </code></pre>
  
  <p>The code above pulls out the alpha2code (country code) for a specific array ([5] in this example). Which is the goal, but I need to somehow automate the process so it goes through all 250 arrays, pulls all the country codes and stores them in separate variable.</p>