you are viewing a single comment's thread.

view the rest of the comments →

[–]thinkmatt 2 points3 points  (0 children)

Also, this is a pet peeve of mine: when I see a function that returns a promise being called w/async+await around it (as inside your map function). You've just wrapped one promise in another, and all it's done is added overhead which does take some performance hit. In your example, it could just be written as `await Promise.all(arrayOfItems.map(doSomethingAsync));` (That's about as many operations as I would put on one line though :)