DEV Community


Discussion on: Dealing with Promises In an Array with async/await

4umfreak profile image
Mark Voorberg • Edited

I did not mean for-await-of, I mean:

  for (var i = 0; i < asyncFunctions.length; i++) {
    var result = await asyncFunctions[i]();

Less code, less cognitive overhead!

Thread Thread
afifsohaili profile image
Afif Sohaili Author

Yeah, that's definitely a more readable approach. I have to be honest I haven't used for loops in a while so it didn't really occur to me.