title: Javascript object memory management when using delete on property
body: <p>I'm currently writing a node.js/socket.io application but the question is general to javascript.</p>
  
  <p>I have an associative array that store a color for each client connection. Consider the following:</p>
  
  <pre><code>var clientColors = new Array();
  
  //This execute each new connection
  socket.on('connection', function(client){   
  clientColors[client.sessionId] = "red";
  
      //This execute each time a client disconnect
      client.on('disconnect', function () {
          delete clientColors[client.sessionId];
      });
  });
  </code></pre>
  
  <p>If I use the delete statement, I fear that it will make a memory leak as the property named after <code>client.sessionId</code> value(associative arrays are objects) won't be deleted, its reference to its value will be gonne but the property will still exist in the object.</p>
  
  <p>Am I right?</p>