title: Javascript value changes outside jquery.post
body: <p>I have a weired bug that is driving me crazy for some time now. I have the following piece of code:</p>
  
  <pre><code>function isLoggedIn() {
  
      var loggedIn = false;
  
      var requestData = {
          action: 'explore-webdesign-is-loggedin',
          request_url: location.protocol + '//' + location.host + location.pathname,
          async: false,
          data: null
      };
      jQuery.post(ajaxurl, requestData, function(data) {
  
          var dataObj = JSON.parse(data);
          if (dataObj.success === true) {
              loggedIn = true;       
              alert("1.) " + loggedIn);
          }
      });    
      alert("2.) " + loggedIn);
      return loggedIn; 
  };
  </code></pre>
  
  <p>Javascript spitts out both alerts, which is fine, however the first one says '1.) true' while the second one gives me '2.) false'. What is going on?</p>