title: How to get the return value of a callback function [API Request]
body: <p>I want to do an API request and display the body in a table on my site. I'm using Node.JS, React and Request. This is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var requestResult = Request.get('https://test.ipdb.io/api/v1/assets/?search=asdf', (err, res, body) =&gt; {
    return body;
  });</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is obviously not working. I can console.log(body), but I want the API response to be available outside the callback function. Is that possible?</p>