title: Unable to store value in global variable JS
body: <p>I have a following piece of javaScript code:</p>
  
  <pre><code>  var ws_path = "x";
   $.get('ws.config', function(data) {
  
        ws_path = data;
        alert(ws_path); //alert 1
   }, 
  'text');
  
   alert(ws_path); // alert 2
  
  
  
    // output = alert 1 = value of data
     //         alert 2 = x
  </code></pre>
  
  <p>I have a confusion' why it is behaving like this?</p>