title: async await work differently btw forEach and native for loop in Javascript
body: <p>I have a huge list of array of object, and I have an API endpoint that has queue limit, I got error
  writing this</p>
  
  <pre><code>arr.forEach(async o =&gt; {
    const result = await callAPI(o.id)
  
    //do something
  })
  </code></pre>
  
  <p>but it is fine when I convert forEach to native for loop</p>
  
  <pre><code>for (let i = 0; i &lt; arr.length; i++) {
      const o = arr[i];
      const result = await callAPI(o.id)
  
    //do something
  };
  </code></pre>
  
  <p>Why? as I know I can do something similar with map where it is async, like</p>
  
  <pre><code>const transformedResult = Promise.all(arr.map(o =&gt; ({...o, newProp: await callApi(o.id) }) )
  await transformedResult //will wait till callApi is resolved
  </code></pre>