Note: Producing code is that which will take some time to run and consuming code is that which has to wait for the result.
The Promise.all() method is used to iterable promises and it returns a single Promise that is the result of other Promises.
You can use
Promise.all() method when you want to run multiple promises and wait for them all to be resolved successfully and returns an array of results of the input promises.
Please note that if one of the promises fails, the whole operation will be rejected. See the following example code to understand.
The above code will run all promises greeting, user, and interest together and wait for the result array and then print them.