title: In Javascript, global variable is not changing value inside a function
body: <pre><code>var a = 1;
  
  function b() {
      function a() {}; // local scope
      a = 10; // global scope
  }
  b();
  alert(a);
  </code></pre>
  
  <p>It alerts 1 and not 10. I am wondering why is it so?</p>