title: How can I convert an async iterator to an array?
body: <p>Given I have an async generator:</p>
  
  <pre><code>async function* generateItems() {
      // ...
  }
  </code></pre>
  
  <p>What's the simplest way to iterate all the results into an array? I've tried the following:</p>
  
  <pre><code>// This does not work
  const allItems = Array.from(generateItems());
  </code></pre>
  
  <pre><code>// This works but is verbose
  const allItems = [];
  for await (const item of generateItems()) {
      allItems.push(item);
  }
  </code></pre>
  
  <p>(I know this is potentially bad practice in a Production app, but it's handy for prototyping.)</p>