Promises
Promise.allSettled()
Fulfills with outcome objects in input order after all inputs settle.
Formal Syntax & Structure
nodejs syntaxnodejs
Promise.allSettled(iterable)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| iterable | Iterable | Values or promises to observe. |
Return Value
Promise
Array of fulfilled or rejected outcome records.
Working Example
Example Snippetnodejs
const r = await Promise.allSettled([1, Promise.reject('missing')]);console.log(r.map(x=>x.status).join(','));