Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Return a new Promise that tracks an array of results and a completion counter. For each input promise, attach a then handler that stores the resolved value at the correct index and increments the counter. Resolve when the counter reaches the total; reject immediately on any failure.
Storing results by index rather than push order preserves the original promise ordering, and the counter ensures we wait for all promises regardless of which resolves first.
Updated Feb 2026