title: How to access value from fetch call in a variable in react
body: <p>How to assign value in a variable in the Fetch call of react.
  As I have made 2 API call one after another using map in JS
  Was Facing the issue of how we can access data from another function</p>
  <pre><code>var data = &quot;&quot;
  fetch(url,{})
  .then((res)=&gt; res.json())
  .then((output) =&gt; data = output)
  </code></pre>