title: Do scopes get cleaned up if they are useless?
body: <p>Pseudo example code illustrating a use case(may or may not compile)</p>
  
  <pre><code>+function($){
      var enableapp = 'enable-application';
      var x = function(something) {
        this.thing = something;
        this.dosomething();
      }
      x.prototype.dosomething = function() {
         console.log(this.thing);
      }
      $('[data-fancy]').each(function(index,elem) {
         var fancy = $(elem);
         if(fancy.is('[data-'+enableapp+']') &amp;&amp; fancy.data(enableapp) == 'yes') {
            fancy.data('app', new x(fancy));
         }
         else {
             fancy.removeData('app');
         }
  
  }(jQuery)
  </code></pre>
  
  <p>In this example I'm starting up a scoped function to register my 'applicaton' X to elements  marked with data-fancy, which have set enable-application to 'yes'</p>
  
  <p>because I need to use this access key multiple times, and might be subject to frequent changes, I decided to store it in a variable in the outermost scope, where I can use it for the several checks and balances.</p>
  
  <p><strong>My question is:</strong></p>
  
  <p>If I don't use the <code>enableapp</code> variable in the X application, with the outermost scope get garbage collected when the intial course has been run? or will it stay in memory until the last Application object is cleared and will no more be initialised.</p>