title: JavaScript Fetch API JSON data inside a variable?
body: <p>JS newbie here. I would like to store the JSON data from an API call inside a variable in my .fetch method.</p>
  <p>Here is my current code:</p>
  <pre><code>// Store database to array
  let database = []
  
  fetch('./database.json')
  .then(response =&gt; response.json())
  .then(data =&gt; console.log(data))
  </code></pre>
  <p>The data is being logged in the console succesfully, but I would like for them to be saved inside the database array.</p>
  <p>Any idea how I would go about that?
  Thank you all so much!</p>