We should not forget await
Quoting We should not forget the await
(Exploring ECMASCript 2016-2017;
5.3.1 Don’t forget
await)
[
out
value] is set to aPromise
, which is usually not what you want in async functions.await
can even make sense if an async function doesn’t return anything.
Source: Exploring ECMASCript 2016-2017, see-also (Returned Promises are not wrapped, Common Promise chaining mistakes, Tips for error handling)
Returning a promise from a promise, the engine will unpack and flatten it
Returning a promise from a promise, the engine will unpack and flatten it (Exploring ES6; 25. Promises for asynchronous programming)