News for hackers. Stuff that matters.
Re:Beware of Async/Await by jakear on Thursday July 30, 2020 @01:34PM (#24000852)
Most ergonomic IMO is:

const getPeople = async () => (await Promise.all(...)).flat()

Without await this would be

const getPeople = () => Promise.all(...).then(arrs => arrs.flat())

The difference is slight to be sure, but I usually prefer the await approach.

There are no comments on this comment yet.