Quantcast
Viewing all articles
Browse latest Browse all 56

Comment by Ben Aston on Why can I use an arrow function before it's declared in a async function

In the first example, invocation of settingsDataAvailable(...) occurs at minimum one microtask later due to the presence of an await. This means that the synchronous top-level evaluation of the entire script will have completed before that invocation is reached. In your second example you are merely attempting to synchronously reference an identifier inside its temporal dead zone.

Viewing all articles
Browse latest Browse all 56

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>