JS Built-ins
AsyncPatternsadvanced

Promise.all([]) resolves to array synchronously observable

πŸ“– Usage Example
const results = await Promise.all([]);
// []

Promise.all([]) resolves immediately with an empty array.

Empty Array Promise

Promise.all([]) resolves to an empty array. The resolution is asynchronous but we can track it.

Challenge: Verify synchronously that Promise.all([]) creates a Promise and check that a .then callback is queued.

πŸ’‘ Hints (3)
  • β€’ Promise.all([]) creates a Promise that resolves to an empty array.
  • β€’ The .then callback is queued as a microtask, not executed immediately.
  • β€’ Use this to understand the microtask queue.