title: Memory management for a tree object implementation in js
body: <p>I try to implement a <em>quad tree</em> and I have a question about the clear function.<br>
  For the moment, the tree is re-build at each step update and before that, we must clear the current structure.</p>
  
  <p>I saw some differents implementations like <a href="https://github.com/mikechambers/ExamplesByMesh/blob/master/JavaScript/QuadTree/src/QuadTree.js" rel="nofollow">this</a>.
  In the clear method, we nullify the objects array and the sub-nodes array 
  <strong>recursively</strong> <code>(array.length = 0)</code>.</p>
  
  <p>Why? Is the behavior of the garbage collector is different if we simply nullify the root node? ('cause the sub-nodes can't be accessible anymore) <strong>or its a 'just to be sure' issue ?</strong></p>
  
  <p>Thanks!</p>