title: Number of elements in a javascript object
body: <p>Is there a way to get (from somewhere) the number of elements in a Javascript object?? (i.e. constant-time complexity).</p>
  <p>I can't find a property or method that retrieves that information. So far I can only think of doing an iteration through the whole collection, but that's linear time.<br />
  It's strange there is no direct access to the size of the object, don't you think.</p>
  <p><strong>EDIT:</strong><br />
  I'm talking about the <code>Object</code> object (not objects in general):</p>
  <pre><code>var obj = new Object ;
  </code></pre>