I have come across two common styles of async/await JavaScript code:
for await (const a of [x1, x2, x3, x4])
{
//do stufF
}
and
[x1, x2, x3, x4].forEach(async (a) {
//do stuff
}
Are there any performance (or other) advantages to either of these?
edit: Assume that each instance of x
is a promise.