title: console.log / Select single key from array?
body: <p>I set up a django REST framework API, it´s connected to a django model with random data. I am able to load the API Data, in a JSON Format, into a HTML Box after pressing a button. i called it <strong>JSON Data Finder</strong></p>
  
  <pre><code>&lt;div class="container-fluid"&gt;
  
  &lt;script&gt;
      document.addEventListener('DOMContentLoaded', function () {
          document.getElementById('getJSONdataTest').onclick = function () {
              req = new XMLHttpRequest();
              req.open("GET", 'http://127.0.0.1:8000/cars/', true);
              req.send();
              req.onload = function () {
                  json = JSON.parse(req.responseText);
                  document.getElementsByClassName('data box')[0].innerHTML = JSON.stringify(json);
                  console.log(json);
                  // Print
              };
          };
      });
  &lt;/script&gt;
  &lt;style&gt;
  
      body {
          text-align: center;
          font-family: "Helvetica", sans-serif;
      }
  
      h1 {
          font-size: 2em;
          font-weight: bold;
      }
  
      .box {
          border-radius: 5px;
          background-color: #eee;
          padding: 20px 5px;
      }
  
      button {
          color: white;
          background-color: #4791d0;
          border-radius: 5px;
          border: 1px solid #4791d0;
          padding: 5px 10px 8px 10px;
      }
  
          button:hover {
              background-color: #0F5897;
              border: 1px solid #0F5897;
          }
  &lt;/style&gt;
  &lt;h1&gt;JSON Data Finder&lt;/h1&gt;
  &lt;p class="data box"&gt;
      The Data will go here
  &lt;/p&gt;
  &lt;p&gt;
      &lt;button id="getJSONdataTest"&gt;
          Get Data
      &lt;/button&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p></p>
  
  <p>this is the output in my <strong>JSON Data Finder</strong> when i click the Button:</p>
  
  <blockquote>
    <p>{"count":4,"next":null,"previous":null,"results":[{"id":3,"name":"Audi","price":11},{"id":2,"name":"Mercedes","price":22},{"id":1,"name":"BMW","price":99},{"id":4,"name":"Trabant","price":113}]}</p>
  </blockquote>
  
  <p><strong>---------------------------</strong></p>
  
  <p>Now i would like to target a specific object or value of a key, after pressing the button.</p>
  
  <p>example:</p>
  
  <pre><code>console.log(json[2].name);
  </code></pre>
  
  <p>So the Output should show me the name of object 3</p>
  
  <blockquote>
    <p>Audi</p>
  </blockquote>
  
  <p><strong>---------------------------</strong></p>
  
  <p>unfortunately nothing happens and the console displayed a error</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'name' of undefined
        at XMLHttpRequest.req.onload ((index):111)</p>
  </blockquote>
  
  <p>i guess that JavaScript can not interpret my Output because the Array is not "clean"? because of this</p>
  
  <blockquote>
    <p>{"count":4,"next":null,"previous":null,</p>
  </blockquote>
  
  <p>in front of my result?</p>
  
  <blockquote>
    <p>"results":[{"id":3,"name":"Audi","price":11},{"id":2,"name":"Mercedes","price":22},{"id":1,"name":"BMW","price":99},{"id":4,"name":"Trabant","price":113}]}</p>
  </blockquote>