title: Function return async response
body: <p>Like a person asked here (but his solutions as to call a nother function) <a href="https://stackoverflow.com/a/10796326/315200">https://stackoverflow.com/a/10796326/315200</a> ...I would like to know if its possible to have a function which doesn't call a second function on response of an async request, but simply <code>return</code> when the async request responses.</p>
  
  <p><strong>Something like this maybe:</strong></p>
  
  <pre><code>function callToFacebook() {
      var fbResponse;
  
      FB.api('/me', function (response) {
          fbResponse = response;
      });
  
      return fbResponse; //Will return undefined because CallToFacebook is async
  }
  </code></pre>
  
  <p>Isn't that possible some way, without calling another function??</p>
  
  <p>What I'm trying to achieve is to have one function I can call with some parameters, which will return the response <code>object</code> from a async webservice, like FB.</p>