jQuery - remove list items based off of time
<p>I currently have a page that contains an unordered list.  That list is initially populated by querying my db, with each list item having a time stamp and text.  Using javascript and AJAX, this page updates the unordered list dynamically every 10 seconds, if new data has come in.  </p>

<p>What is the easiest and most efficient way to remove list items from this unordered list if the items are older than 24 hours?</p>

<p>My inclination is to do the following:</p>

<ol>
<li>In the js file, load all list items in the unordered list into an array</li>
<li>During the js call to get data, if data comes back, add those items to the array as well</li>
<li>Every time the getData() function is called, also call a removeData() function that removes all items that are older than 24 hours.   </li>
</ol>

<p>Also, I have had issues trying to figure out the correct way to add list items to a javascript array.  Here is the code that I have been trying for adding all list items to an array:</p>

<pre><code>  var list = new Array();
  $(".listname").each(function (i){
    list.push($(this));
  });
</code></pre>

<p>to remove list items from the array, I expect to use:</p>

<pre><code>list.pop();
</code></pre>
