title: JavaScript variable scope
body: <p>I have declared var1 inside the function. However, when i try to assign a value in inner_function2, it seems another var1 is create instead of referencing to the first one. </p>
  
  <pre><code>var func1 = function(response) {
  
      var var1;
  
      function inner_function2(param) {
  
          Ext.Ajax.request({
              url:'',
              params: param,
              success:function(result, request) { 
                  var1 = a;
                  }
              });
      }   
  
  }()
  </code></pre>