javascript - objects immutable?
<p>I'm attempting to create something of a tree structure.</p>

<p>I wish to access my data as follows:</p>

<pre><code>data[key1][key2]
</code></pre>

<p>However, key1 and key2 have a symmetric relationship; the following is always true:</p>

<pre><code>data[key1][key2] == data[key2][key1]
</code></pre>

<p>More specifically, I have <code>data[key1][key2]</code> and <code>data[key2][key1]</code> pointing to the same object, such that changes to one affect the other.</p>

<p>My problem arises because I wish to delete the underlying object. I know if I use:</p>

<pre><code>delete data[key1][key2];
</code></pre>

<p><code>data[key2][key1]</code> still refers to the object.</p>

<p>My question is this: is there any way to remove the underlying object, or overwrite it with something falsey, such that both properties above will evaluate falsey?</p>
