3 ms·
But I maintain that in the illustrated case - where you want to get all the different independent values and then combine them at the end - it's actually less e
by brundolf 6y ago
But I maintain that in the illustrated case - where you want to get all the different independent values and then combine them at the end - it's actually less ergonomic to do it the wrong way with .then(...) than it is to do it the right way.
- jakear 6y agoMost 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.