title: ajax call returns value but variable is null
body: <p>I am trying to get a weather forecast from <a href="http://openweathermap.org/" rel="nofollow">here</a>. This is working fine and I get my value. If I do a normal ajax call it is working fine. </p>
  
  <p>But: </p>
  
  <pre><code>function Weather() {
      var self = this,
          weatherUrl = 'http://api.openweathermap.org/data/2.5/weather?id=',
          value = null;
  
      function getWeatherForCity(id) {
          $.ajax({
              url: weatherUrl + id,
              async: false,
              success: function (data) {
                  console.log(data);
                  value = data;
              }
          });
      }
  
      self.getWeatherForCity = function (id) {
          var cast = value;
          console.log(cast);
          return cast;
  
      };
  }
  </code></pre>
  
  <p>The call: </p>
  
  <pre><code>        weather = new Weather();
  
          console.log(weather.getWeatherForCity('2878234'));
  </code></pre>
  
  <p>If I debug through those functions, I get the good result inside of the success callback function, but cast variable is null, like it was never touched? </p>
  
  <p>Could someone explain that to me? </p>