title: How to save the response from an asynchronous call to variable
body: <p>I have a API call and I expected to write response to <code>friends</code> variable.</p>
  
  <pre><code>getFriends = function() {
    return VK.Api.call('friends.get', {}, function(response) {
      if (response.response)
        response.response;
    });
  };
  
  var friends = getFriends();
  console.log(friends)  // undefined;
  </code></pre>
  
  <p>In <a href="https://stackoverflow.com/questions/30542292/how-to-return-result-of-function?noredirect=1#comment49157726_30542292">my previous question one guy told me that I can fix it with callback</a> function and close my question. I implement a callback but again I can't get a response.</p>
  
  <pre><code>var getFriends = function(callbackFn) {
    return VK.Api.call('friends.get', {}, function(response) {
      if (response.response) {
        callbackFn(response.response);
      }
    });
  };
  
  var friends = getFriends(function(list) { return list; });
  </code></pre>
  
  <p>How I can write <code>response.response</code> to variable for a lot of next manipulations?</p>