title: JavaScript JSON Object Object error
body: <p>I am trying to print out the key and value names from the data below e.g. "Player 1' - 'ball' 'hat' and "Player 2 - 'ball, 'hat'.  So keys have multiple value names but im not sure how i print these out.** I am getting '[object Object]' as a response**. Can someone help me with this understanding please and trying to resolve the matter.</p>
  
  <p><strong>Data</strong></p>
  
  <pre><code>{
      "Player1": {
          "ball": 1,
          "hat": 2
  
      },
      "Player2": {
          "ball": 1,
          "hat": 2,
      }
  }
  </code></pre>
  
  <p><strong>JavaScript</strong></p>
  
  <pre><code>$.getJSON('data.json', function (data) {
      var response = data;
      for (key in response){
          alert("key: " + key + "value :" + response[key]);
      }
  });
  </code></pre>