title: the correct way to delete object in an array for node.js?
body: <p>I have written a function for deleting object preiodically.</p>
  
  <pre><code>function add(variable, expireSecond){
      this.list[variable] = {"expireSecond": expireSecond, "addTime": (new Date().getTime()) / 1000};
  }
  
  function deleteExpiredObject(){
      var currentTime = (new Date().getTime()) / 1000;
      for (var key in this.list) {
          var item = this.list[key];
          if (item.expireSecond + item.addTime &lt; currentTime){
              delete this.list[key];
          }
      }
  }
  </code></pre>
  
  <p>When I use it, I tried to do the following:</p>
  
  <pre><code>add(xxx[1], 300);
  </code></pre>
  
  <p>But when I called <code>deleteExpiredObject()</code>, it seems that the memory is not free after the object is expired. Is it due to non-zero reference of the object in <code>xxx[1]</code>? How to solve? Is there any library I can use?</p>
  
  <p>Thanks!</p>