5 ms·
Most ergonomic IMO is: const getPeople = async () => (await Promise.all(...)).flat() Without await this would be const getPeople = () => Promise.all(...).the
by jakear 6y ago
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.