title: How to store fetch response in a variable? i have tried async await too
body: <p>What I tried -
  I created an empty variable that has an initial value of an empty array,
  inside fetch I have pushed the response to an empty array but not able to get data.</p>
  <pre><code>let covidData=[];
  
  
  function fetchData(){
      fetch('https://jsonplaceholder.typicode.com/users')
      .then(response=&gt;response.json())
      .then(data=&gt;
        covidData.push(data)
      )
      .catch(error=&gt;{
          console.log(&quot;error&quot;,error)
      })
  }
  fetchData();
  
  console.log(covidData)
  </code></pre>
  <p><strong>Currently, I'm am getting an empty array</strong></p>