You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/11-async/05-promise-api/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -309,15 +309,15 @@ In practice, this method is almost never used.
309
309
310
310
## Summary
311
311
312
-
There are 5 static methods of `Promise` class:
312
+
There are 6 static methods of `Promise` class:
313
313
314
314
1. `Promise.all(promises)` -- waits for all promises to resolve and returns an array of their results. If any of the given promises rejects, it becomes the error of `Promise.all`, and all other results are ignored.
315
315
2. `Promise.allSettled(promises)` (recently added method) -- waits for all promises to settle and returns their results as an array of objects with:
316
316
- `status`: `"fulfilled"` or `"rejected"`
317
317
- `value` (if fulfilled) or `reason` (if rejected).
318
318
3. `Promise.race(promises)` -- waits for the first promise to settle, and its result/error becomes the outcome.
319
-
4. `Promise.any(promises)` -- waits for the first promise to fulfill, and its result becomes the outcome. If all of the given promises are rejected, [`AggregateError`](mdn:js/AggregateError) becomes the error of `Promise.any`.
319
+
4. `Promise.any(promises)` (recently added method) -- waits for the first promise to fulfill, and its result becomes the outcome. If all of the given promises are rejected, [`AggregateError`](mdn:js/AggregateError) becomes the error of `Promise.any`.
320
320
5. `Promise.resolve(value)` -- makes a resolved promise with the given value.
321
321
6. `Promise.reject(error)` -- makes a rejected promise with the given error.
322
322
323
-
Of these five, `Promise.all` is probably the most common in practice.
323
+
Of all these, `Promise.all` is probably the most common in practice.
0 commit comments