title: Promise.all([]) returns a resolved promise, but Promise.race([]) returns a pending promise. Why are they different?
body: <p>If either Promise.all or Promise.race are called with a non-empty array, they return a pending promise:</p>
  
  <pre><code>console.log(Promise.all([1]));
  // prints Promise {&lt;pending&gt;}
  console.log(Promise.race([1]));
  // returns Promise {&lt;pending&gt;}
  </code></pre>
  
  <p>If Promise.race is called with an empty array, it returns a pending promise:</p>
  
  <pre><code>console.log(Promise.race([]));
  // prints Promise {&lt;pending&gt;}
  </code></pre>
  
  <p>But if Promise.all is called with an empty array, it returns a promise that is already resolved:</p>
  
  <pre><code>console.log(Promise.all([]));
  // prints Promise {&lt;resolved&gt;: Array(0)}
  </code></pre>
  
  <p>Why was the Promise.all function designed like this? It seems like there's no good reason for the inconsistency, but maybe I'm missing something.</p>