My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

If top level await is a bad idea, then is await worth having at all ?

Lorefnon's photo
Lorefnon
·Sep 30, 2016

It has been postulated (with sound reasoning) that top level await is a bad idea.

If so, are there any advantages to having await at all, when we already have yield.

Having async is useful because an async function is guaranteed to return a promise irrespective of what is actually returned by the code. But do have some similar reasoning behind await as well ?