Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Become a Member
Become a member
to unlock all features

    Wait for Multiple JavaScript Promises to Be Fulfilled with Promise.all()


    The Promise.all() method accepts an array (or any other iterable) of promises as a parameter. It returns a Promise object that is fulfilled if all of the input promises are fulfilled or rejected if any of the input promises is rejected:

    • If all input promises are fulfilled, the returned Promise object is fulfilled with an array of fulfillment values of all promises (in the same order as the promises passed to Promise.all()).
    • If any input promise is rejected, the returned Promise object is rejected with that reason.