title: javascript: passing global var to function
body: <p>I have a global variable MyGlobalVar and some code that looks like this:</p>
  
  <pre><code>var MyGlobalVar = null;
  
  function PlayWithMyGlobal() {
      MyGlobalVar = new Object();
      .... adding properties to MyGlobalVar
      MoreFun(MyGlobal);
  }
  
  function MoreFun(TheVar) {
      is TheVar here a local or just a reference to the global?
  } 
  </code></pre>
  
  <p>If I pass the global variable, am I still working with the global?
  Thanks.</p>