title: ASYNC forEach function in JS not occuring in expected order
body: <p>I seem to be really confused as to how <code>async</code> and <code>await</code> is supposed to work here. I am trying to get this <code>forEach</code> function to occur before the <code>console.log</code> and <code>res.json</code>.  Unfortunately, even when attaching async and await, it is the last thing to occur.</p>
  <pre><code>// Setting tags
  const tags = [&quot;1&quot;, &quot;2&quot;, &quot;3&quot;];
  
  app.get(&quot;/api/posts&quot;, async (req, res) =&gt; {    
      try {
          tags.forEach(async function (tag) {
              const response = await fetch(api_url + &quot;?tags=&quot; + tag);
              const response_1 = await response.json();
              console.log(tag);
              await api_json.push(response_1);
          });
      }
      catch (error){
          console.log(error);
      }
      console.log(api_json);
      res.json(api_json);
  });
  </code></pre>
  <p>And the output:</p>
  <pre><code>[]
  1
  2
  3
  </code></pre>
  <p>I am not sure how else to change the order of which these functions can occur.  Any help would be appreciated.  Thanks.</p>