title: fetch: push items to array
body: <p>I'm struggling to see whats wrong here. I'm pulling in some json (yes I know I'm using a text file).  I have an array in the global scope I want to push entries to, i'm iterating over the json and pushing it to that array. Only when I log it out It's empty. It's probably something stupid, but any assistance would be greatly appreciated. </p>
  
  <pre><code>let charities = [];
  fetch('../mapdata/markers.txt').then(response =&gt; {
          if (response.ok) {
              return response.json();
          }
          throw new Error('Network response error.');
      })
      .then(charData =&gt; {
          console.log(`inside: ${JSON.stringify(charData, null, 2)}`);
          charData.map(entry =&gt; {
              return charities.push(entry);
          });
      })
      .catch(error =&gt; {
          console.log('There has been a problem: ', error.message);
      });
  console.log(`outside: ${JSON.stringify(charities, null, 2)}`);
  </code></pre>
  
  <p>And as it type I'm thinking this might be an async issue...</p>