title: Javascript: loop through all records within an object with an irregular key
body: <p>UPDATED</p>
  
  <p>I've got an object <code>var myObject = {};</code></p>
  
  <p>I build it using a key like so: </p>
  
  <pre><code>myObject[key] = {
     name: ...
  };
  </code></pre>
  
  <p>So imagine I have created three records:</p>
  
  <pre><code>myObject[13] = {...};
  myObject[281] = {...};
  myObject[76] = {...};
  </code></pre>
  
  <p>I now want to loop through the object as if it were an array. </p>
  
  <pre><code>var i,
      length = myObject.length;     // ?? Problem here 'cos it ain't an array
  
  for (i = 0; i &lt; length; i += 1) {
      ????
  };
  </code></pre>
  
  <p>How can I refer to the three elements at <code>????</code>? I don't know the numbers 13, 281 &amp; 76, and <code>myObject[0]</code> is not going to find the first record.</p>
  
  <p>Thanks.</p>