Garbage collector: deleting a reference to an object that has references to another object
<p>From what I understand, the JS garbage collector removes objects that are no longer referenced. Suppose I remove a reference to an object and that object has a property which is a reference to another object. Will both objects be removed?</p>

<p>e.g    </p>

<pre><code>var objectA = {
    prop1: "property",
    prop2: "property"
}

var objectB = {
    refToA: objectA
}

// Remove reference to objectA
delete objectA;

// Remove reference to objectB
delete objectB
</code></pre>

<p>Are both objects now completely removed from memory? </p>
