Merge pull request #2640 from ZYinMD/patch-17

slightly improve clarity of Promise.all()
This commit is contained in:
Ilya Kantor 2021-06-20 00:56:53 +03:00 committed by GitHub
commit 1b16f9d09a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ let promise = Promise.all([...promises...]);
`Promise.all` takes an array of promises (it technically can be any iterable, but is usually an array) and returns a new promise.
The new promise resolves when all listed promises are settled, and the array of their results becomes its result.
The new promise resolves when all listed promises are resolved, and the array of their results becomes its result.
For instance, the `Promise.all` below settles after 3 seconds, and then its result is an array `[1, 2, 3]`: