title: How to set variable value with a promise
body: <p>I'm stuck figuring how set a variable value (ex. response of an ajax call) using promises.</p>
  
  <p>I have for instance:</p>
  
  <pre><code>something.value = getVariable('id'); // { id : 'Adam Smith' }
  </code></pre>
  
  <p>where</p>
  
  <pre><code>getVariable(id) { 
      return $.ajax({
      //...
  }).done(function(response) {
      //... getVariable return response
  }).fail(function(response) {
      //... getVariable return something_else
  });
      // ...
  </code></pre>
  
  <p>getVariable should change from promise to ajax (or any other asynchronous) response value once done().</p>