title: How to await multiple Promises?
body: <p>I have following code, <code>fileStatsPromises</code> is of <code>Promise&lt;Stats&gt;[]</code>, both <code>foo</code> and <code>bar</code> are <code>Promise&lt;Stats&gt;[]</code>. What is the correct way to await them? I want to get <code>&lt;Stats&gt;[]</code>.</p>
  
  <pre><code>    const files = await readDir(currentDir);
      const fileStatsPromises = files.map(filename =&gt; path.join(currentDir, filename)).map(stat);
  
      const foo = await fileStatsPromises;
      const bar = await Promise.all(fileStatsPromises);
  </code></pre>
  
  <p>EDIT: a minimal example.</p>
  
  <pre><code>function makePromise() {
      return Promise.resolve("hello");
  }
  const promiseArray = [];
  // const promiseArray = [] as Promise&lt;string&gt;[];
  for (let i = 0; i &lt; 10; i++) {
      promiseArray.push(makePromise());
  }
  
  (async () =&gt; {
      const foo = await promiseArray;
      const bar = await Promise.all(promiseArray);
  })();
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/WavcF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WavcF.png" alt="Screenshot"></a></p>