title: Javascript Object push() function
body: <p>I have a javascript object (I actually get the data through an ajax request):</p>
  
  <pre><code>var data = {};
  </code></pre>
  
  <p>I have added some stuff into it:</p>
  
  <pre><code>data[0] = { "ID": "1"; "Status": "Valid" }
  data[1] = { "ID": "2"; "Status": "Invalid" }
  </code></pre>
  
  <p>Now I want to remove all objects with an invalid status (but keep everything the ordering same):</p>
  
  <pre><code>var tempData = {};
  for ( var index in data ) {
      if ( data[index].Status == "Valid" ) {
          tempData.push( data );
      }
  }
  data = tempData;
  </code></pre>
  
  <p>In my mind, all of this should work, but I am getting an error that <code>tempData.push</code> is not a function.  I understand why it isn't the same as an array, but what could I do otherwise?</p>