Deleting Reference to Object in Different Context
<p>I am implementing a binary tree in JavaScript and need to be able to pass a variable to a function, and set the value of the variable within it's initial context to undefined from inside the function.</p>

<p>Example:</p>

<pre><code>var foo = {}

function bar(a) { a = undefined }

bar(foo)
</code></pre>

<p>In this context, <code>foo</code> is still defined.</p>

<p>I realise this won't work like this, but how can I do something similar in JS?
Also, <code>foo</code> won't always be global.</p>
