title: Node.js undefined variable
body: <p>functions.js</p>
  
  <pre><code>var number;
  
  function test(){
  
       number = 1;
  
  }
  
  exports.number = number;
  </code></pre>
  
  <p>In the file <code>test.js</code> i would try to get the variable number:</p>
  
  <pre><code>var Functions = require('functions.js');
  var test = Functions.number;
  console.log(test);
  </code></pre>
  
  <p>But its returning always <code>undefined</code>, what is the best solution to fix this?
  Is it the wrong thing the global variable? Even if i try to export an function its always returns undefined</p>