await vs return vs return await

When writing async functions, there are differences between await vs return vs return await, and picking the right one is important. This returns a promise that waits a second, then has a 50/50 chance of fulfilling with “yay” or rejecting with an error.


View original article


Posted

in

by

Tags:

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from try {} except

Subscribe now to keep reading and get access to the full archive.

Continue reading