title: Does this Javascript cause a memory leak?
body: <p>Notice in the following code, the child gets a reference to its parent.  What happens when the original reference to parent is set to null?  Does the parent stay around since there still is an active reference from the child?</p>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>var parent = function() {
    var self = this;
    self.runme = function() {
      document.getElementById('output').innerText = 'run me';
    }
  
    self.child = new child(self);
  
    return self;
  }
  var child = function(parent) {
    var self = this;
    var parent = parent;
    self.event = function() {
      parent.runme();
    }
  }
  var p = new parent();
  p.child.event();
  p = null;
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="output"&gt;
    old value
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>FIDDLE</strong>
  <a href="https://jsfiddle.net/jeljeljel/8fvy5r4f/" rel="nofollow">https://jsfiddle.net/jeljeljel/8fvy5r4f/</a></p>