title: How to open json file with objects in d3?
body: <p>I want to load one json file for a d3 world map (based on: <a href="http://datamaps.github.io/" rel="nofollow">http://datamaps.github.io/</a>) and a d3 bar chart (based on: <a href="https://bl.ocks.org/mbostock/3885304" rel="nofollow">https://bl.ocks.org/mbostock/3885304</a>).</p>
  
  <p>My JSON looks like this:</p>
  
  <pre><code>{
  "CHE":  {"costOfLivingIndex": "123.10", "propertyPriceToIncomeRatio": "123.10", "qualityOfLifeIndex": "208.54", "name": "Switzerland", "purchasingPower": "178.74", "pollutionIndex": "28.73", "trafficCommuteTimeIndex": "8.57", "health Care Index": "68.88", "climateIndex": "23.02", "safetyIndex": "74.27"},
  "DNK":  {"costOfLivingIndex": "84.88", "propertyPriceToIncomeRatio": "84.88", "qualityOfLifeIndex": "206.49", "name": "Denmark", "purchasingPower": "142.14", "pollutionIndex": "25.64", "trafficCommuteTimeIndex": "5.85", "health Care Index": "81.89", "climateIndex": "29.93", "safetyIndex": "74.33"}
  etc...
  }
  </code></pre>
  
  <p>I choose this lay for the d3 world map. However, how I am wondering how I can iterate through properties of the objects. If I do for instance:</p>
  
  <pre><code>console.log(data.DNK.name);
  </code></pre>
  
  <p>I get the name, but how can get a list with all the names (or other values)?</p>