title: Make function declared in a closure global without using window
body: <p>How do I make a function declared in a closure, global ? This is for a google apps script, hence no <strong>window</strong>.</p>
  
  <p>There is documentation on how to use closures in google apps scripts, but the example declares an object instead of a function.
  <a href="http://code.google.com/googleapps/appsscript/articles/appengine.html" rel="nofollow">http://code.google.com/googleapps/appsscript/articles/appengine.html</a><br/>
  var JSON = JSON || {};</p>
  
  <pre><code>// foo = function(){}
  (function ()
  {
      ...
  
      foo = function (a, b)
      {
          ...
      }
  
      foo.prototype =
      {
          ...
      }
  
      // window.foo = foo; // Not Possible
  }());
  </code></pre>