Promise.all([promise1, promise2])
takes an array of promises.
It waits for both promise1
and promise2
to resolve.Promise.all
returns objects with several info about the HTTP request.
The result can be find in the data
property:Promise.all()
will reject, and you'll catch the error in the .catch()
block.