title: get size of JSON object
body: <p>i have a JSON object that gets returned by an AJAX request and I am having some trouble with the <code>.length</code> because it keeps returning <code>undefined</code>. Just wondering if I'm using it right:</p>
  <pre><code>console.log(data.length);
  console.log(data.phones.length);
  </code></pre>
  <p>They both return <code>undefined</code> even though they are valid objects.</p>
  <p><strong>Update:</strong><br>
  Sample of the JSON object returned:</p>
  <pre><code>{&quot;reqStatus&quot;:true,&quot;phones&quot;:{&quot;one&quot;:{&quot;number&quot;:&quot;XXXXXXXXXX&quot;,&quot;type&quot;:&quot;mobile&quot;},&quot;two&quot;:{&quot;number&quot;:&quot;XXXXXXXXXX&quot;,&quot;type&quot;:&quot;mobile&quot;}}}
  </code></pre>