title: local and global scope coffeescript
body: <p>With javascript:</p>
  
  <pre><code>function myFunc() {
      var x = 5;
  };
  
  console.log(x);
  </code></pre>
  
  <p>I get <code>//undefined</code> and with:</p>
  
  <pre><code>function myFunc() {
          x = 5;
      };
  
      console.log(x);
  </code></pre>
  
  <p>I get <code>5</code></p>
  
  <p>With <code>coffeescript</code> this variable <code>var x = 5;</code> is <code>x = 5</code>.</p>
  
  <p>For example this is possible?:</p>
  
  <pre><code>myFunc -&gt;
    window.x = 5;
  
      console.log window.x
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>myFunc -&gt;
   x = 5;
  
   console.log x
  </code></pre>
  
  <p>My question is <strong>How I can differentiate a global variable of a local variable with CoffeeScript?</strong></p>