3 ms·
That's still clunkier than await first await second So lots of people might not ever think to do it the other way. If you don't have intimate knowledge of
by _bxg1 6y ago
That's still clunkier than
await first
await second
So lots of people might not ever think to do it the other way. If you don't have intimate knowledge of how promises work and what async/await really do, you might not even realize that this is wrong.
- furstenheim 6y agoYou can always move it to a variadic function and do await parallel(first, two) If your concern is clunkiness, I'm curious about callbacks, they're definitely more complex to use. I understand your point that not knowing how promises work can lead to not optimizing them, but going from one to the second can easily done on another iteration. On the other hand, not being capable with callbacks can easily lead to (callback) hell, then you need to first fix the mess, then optimize.