title: Javascript - using arguments for closure, bad or good?
body: <p>Let's consider simple singleton implementation:</p>
  
  <pre><code>var singleton = function (Constructor) {
      var singleton;
      return function () {
          if (!singleton) {
              singleton = new Constructor();
          }
          return singleton;
      };
  };
  </code></pre>
  
  <p>We could move declaration of <em>singleton</em> variable to arguments:</p>
  
  <pre><code>var singleton = function (Constructor, singleton) {
      return function () {
          if (!singleton) {
              singleton = new Constructor();
          }
          return singleton;
      };
  };
  </code></pre>
  
  <p>So I simply curious about side effects.</p>
  
  <p>One more example:</p>
  
  <pre><code>var counter = (function (i) {
      return function () {
          i = (i || 0) + 1;
          return i;
      };
  }());
  </code></pre>