title: Count Key/Values in JSON
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5223/length-of-javascript-associative-array">Length of Javascript Associative Array</a>  </p>
  </blockquote>
  
  
  
  <p>I have a JSON that looks like this:</p>
  
  <pre><code>Object:
     www.website1.com : "dogs"
     www.website2.com : "cats"
     &gt;__proto__ : Object
  </code></pre>
  
  <p>This prints when I do this:</p>
  
  <pre><code>console.log(obj);
  </code></pre>
  
  <p>I am trying to get the count of the items inside this JSON, obj.length returns "undefined" and obj[0].length returns </p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'length' of undefined</p>
  </blockquote>
  
  <p>I would expect a length to return "2" in this case. How can I find the count?</p>
  
  <p>Thanks!</p>