Update article.md

This commit is contained in:
joaquinelio 2020-12-19 22:40:31 -03:00 committed by GitHub
parent 1af33d1905
commit 5a14316d8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -316,7 +316,7 @@ There are 6 static methods of `Promise` class:
- `status`: `"fulfilled"` or `"rejected"` - `status`: `"fulfilled"` or `"rejected"`
- `value` (if fulfilled) or `reason` (if rejected). - `value` (if fulfilled) or `reason` (if rejected).
3. `Promise.race(promises)` -- waits for the first promise to settle, and its result/error becomes the outcome. 3. `Promise.race(promises)` -- waits for the first promise to settle, and its result/error becomes the outcome.
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`. 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`.
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.