XHR Garbage collect optimisation
<p>Is this a good way to garbage collect</p>

<pre><code>function getFile() {
    var xhr = new XMLHttpRequest();
    xhr.onload = function() {
        //do stuff
        delete(xhr)
    };
}
</code></pre>

<p>and then call <code>getFile()</code> a couple of times</p>

<p>(I've edited it to use a function)</p>

<p>How would I get rid of <code>xhr</code> when it's done. I'm just a bit confused on whether its ok to remove xhr from within a function of itself</p>
