Last time I asked a question, this question answered the method of asynchronous completion step by step through promise, but today I suddenly thought of another situation. if there are several asynchronous operations that can be performed at the same time, but the following operations cannot be performed until they are all completed, how should they be encoded? Imagine the following:
We need to read a few documents, they have no necessary sequence relationship, as long as they are read, but we must read them before we can proceed to the next step. What should we do?
You can use Promise.all
For specific usage, please refer to:Link description