title: Why does node wait for a single promise, but not an array of promises?
body: <p>Consider this function which mocks querying a database, and returning some records after 2 seconds, via a Promise:</p>
  
  <pre><code>function query() {
    var recs = [1,2,3];
    return new Promise(r =&gt; setTimeout(() =&gt; r(recs), 2000))
  }
  </code></pre>
  
  <p>If I add the following statement:</p>
  
  <pre><code>query().then(console.log);
  </code></pre>
  
  <p>and run the script the with node, it pauses 2 seconds, prints out the records, and returns, as expected.</p>
  
  <p>On the other hand, if I replace that line with an array of the exact same promises:</p>
  
  <pre><code>Array(5).map(x =&gt; query().then(console.log));
  </code></pre>
  
  <p>The script returns immediately, and prints nothing.  Why does node wait for the single promise to return before exiting, but exit immediately when there's an array of 5 unresolved promises?</p>