title: Javascript: Array of dictionaries, get all key value pairs from one dictionairy with condition
body: <p>First of all, this is my first post ever here and I'm not a very advanced programmer. If I don't follow the rules of Stackoferflow, please let me know.</p>
  
  <p>I'm trying to make a scatterplot (and a datamap) for my linked-views assignment using D3. on my x-axis I will have years, on the Y axis I want the life Expectancy of a certain country. The country will be a variable and passed into the function that creates the scatterplot (by clicking on the datamap). </p>
  
  <p>My dataset looks as follows:</p>
  
  <pre><code>    [{"country":"Abkhazia","1995":null,"1996":null,"1997":null,"1998":null,"1999":null,"2000":null,"2001":null,"2002":null,"2003":null,"2004":null,"2005":null,"2006":null,"2007":null,"2008":null,"2009":null,"2010":null,"2011":null,"2012":null,"2013":null,"2014":null,"2015":null,"2016":null},
       {"country":"Afghanistan","1995":49.4,"1996":49.7,"1997":49.5,"1998":48.6,"1999":50,"2000":50.1,"2001":50.4,"2002":51,"2003":51.4,"2004":51.8,"2005":52,"2006":52.1,"2007":52.4,"2008":52.8,"2009":53.3,"2010":53.6,"2011":54,"2012":54.4,"2013":54.8,"2014":54.9,"2015":53.8,"2016":52.72},
        etc.
  </code></pre>
  
  <p>My function starts like this:</p>
  
  <pre><code>function makeScatter(lifeExpectancy, healthPercGDP, country){...
  </code></pre>
  
  <p>I want to have an array or a dict of all the key value pairs or all the values (I think I could make both work) that belong to the country that is passed into my function (e.g. Afghanistan).</p>
  
  <p>Thanks in advance!
          </p>