title: How to use a promise inside an if-condition?
body: <p>The situation is as follows:</p>
  
  <pre class="lang-js prettyprint-override"><code>function evaluateUser(){
  //AJAX call, returning true or false
  }
  
  if(evaluateUser()){
  //do something
  }else{
  //do something else
  }
  </code></pre>
  
  <p>AFAIK jqueryAJAX calls create a promise. So I can indeed do something like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>function evaluateUser(){
  //return AJAX Call
  }
  </code></pre>
  
  
  
  <p>The problem is that I'm just returning a promise, and not the result of the async operation. However, since I'm new to promises, I wonder if I could do something with resolve/reject?</p>
  
  <p>I haven't seen any resolve/reject syntax inside jquery AJAX calls yet, but since they create promises, resolve/reject must be implemented inside them, aren't they?</p>
  
  <p>And if so, can one somehow use resolve/reject to make a distinction between true/false? The async operation really does just that, in the end. 
  So while I can't really "unwrap" the promise generated by the AJAX call, is there at least a way to distinguish between a promise that was rejected and a promise which was resolved? So that I could somehow make the true/false result inside the asynchronous world visible to the synchronous world?</p>