Give me five
This commit is contained in:
parent
a43c18ff18
commit
1af33d1905
1 changed files with 2 additions and 2 deletions
|
@ -309,7 +309,7 @@ In practice, this method is almost never used.
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
There are 5 static methods of `Promise` class:
|
There are 6 static methods of `Promise` class:
|
||||||
|
|
||||||
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.
|
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.
|
||||||
2. `Promise.allSettled(promises)` (recently added method) -- waits for all promises to settle and returns their results as an array of objects with:
|
2. `Promise.allSettled(promises)` (recently added method) -- waits for all promises to settle and returns their results as an array of objects with:
|
||||||
|
@ -320,4 +320,4 @@ There are 5 static methods of `Promise` class:
|
||||||
5. `Promise.resolve(value)` -- makes a resolved promise with the given value.
|
5. `Promise.resolve(value)` -- makes a resolved promise with the given value.
|
||||||
6. `Promise.reject(error)` -- makes a rejected promise with the given error.
|
6. `Promise.reject(error)` -- makes a rejected promise with the given error.
|
||||||
|
|
||||||
Of these five, `Promise.all` is probably the most common in practice.
|
Of all these, `Promise.all` is probably the most common in practice.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue