First, let’s celebrate this site runs for more than a year! In case you don’t know, I removed the Google Analytics last month, cuz I don’t need it to remind me no one reads my blog.
Now back to the main point. Here is the problem:
If we use
Promise.all() here, the final array is correct, but the promises won’t run in order:
reduce() gonna save the day.
Then we need to store the return value:
You see, I learned something today. Never make a promise casually.