Implement a Custom Polyfill for Promise.allSettled()

Write a polyfill for Promise.allSettled() that waits for all input promises to complete regardless of their outcome. Unlike Promise.all(), it never short-circuits — every promise is awaited, and the result is an array of outcome descriptor objects each with a status field of either 'fulfilled' (with a value) or 'rejected' (with a reason). Perfect for batch operations where partial failures are acceptable.

Examples
Input: []
Output:
Hints

Implement a Custom Polyfill for Promise.allSettled()

Write a polyfill for Promise.allSettled() that waits for all input promises to complete regardless of their outcome. Unlike Promise.all(), it never short-circuits — every promise is awaited, and the result is an array of outcome descriptor objects each with a status field of either 'fulfilled' (with a value) or 'rejected' (with a reason). Perfect for batch operations where partial failures are acceptable.