title: CoffeeScript variable scope
body: <p>Is there any way to declare a variable at "file" scope (which will be closured by CS), without initializing it? A contrived example:</p>
  
  <pre><code>init = -&gt;
    counter = 0
  
  inc = -&gt;
    counter += 1
  </code></pre>
  
  <p>This won't work, because you need to declare "counter". Adding "counter = 0" to the top would make it work, but the "= 0" is unnecessary. (A more realistic example would involve something that accesses the DOM on page load - there's no way to correctly initialize it in "file" scope.)</p>