Promise.all([]) returns a resolved promise, but Promise.race([]) returns a pending promise. Why are they different?
问题 If either Promise.all or Promise.race are called with a non-empty array, they return a pending promise: console.log(Promise.all([1])); // prints Promise {<pending>} console.log(Promise.race([1])); // returns Promise {<pending>} If Promise.race is called with an empty array, it returns a pending promise: console.log(Promise.race([])); // prints Promise {<pending>} But if Promise.all is called with an empty array, it returns a promise that is already resolved: console.log(Promise.all([])); //