title: Is it necessary to delete callback function after being called/executed in JavaScript?
body: <p>I have a web-app that polls for data periodically to 3rd party services (say Facebook, Twitter, and so on).
  This poll/request is made via JSONP (to avoid cross-domain issue).</p>
  
  <p>For example, a simple request would be something like this:</p>
  
  <pre><code>function jsonp_callback() {
      // Do something
  }
  
  var url = 'http://some.service.com/getresult?callback=jsonp_callback';
  $http.jsonp(url);
  </code></pre>
  
  <p>However since there can be another type of request that can be made at any given time (for example: to send or post an update), I created a wrapper to handle the callbacks.</p>
  
  <p>The implementation is something like this:</p>
  
  <pre><code>// Callback handler
  var myCb = (function() {
      var F = function() {};
      F.prototype.fn = {};
      F.prototype.create = function(fn, scope) {
          var self = this;
          var id = new Date().getTime();
          self.fn[id] = function() {
              if (typeof fn === 'function') {
                  fn.call(scope);
              }
          }
          return 'myCb.fn.' + id;
      }
      return new F();
  })();
  
  // JSONP request
  var cb = myCb.create(function() {
      // Do something
  });
  var url = 'http://some.service.com/getresult?callback=' + cb;
  $http.jsonp(url);
  </code></pre>
  
  <p>If you notice, after some time, the <strong>myCb.fn</strong> will be bloated will callbacks that were old or have already executed.
  Mu question is, do I need to create a mechanism to garbage-collect those who have been executed and no longer needed?</p>