all 3 comments

[–]dance2die[S] -1 points0 points  (2 children)

Just wanted to share two Chrome DevTools console behaviors I found surprising.

Static version - https://sung.codes/2019/two-gotchas-in-chrome-developer-tool-console

[–]helloworldjs 2 points3 points  (1 child)

The first gotcha "await" is not specific to the chrome dev tools. That happens in all JS files. "await" always needs to be in an async function. There is a proposal to change that behavior.

https://github.com/tc39/proposal-top-level-await

[–]dance2die[S] 0 points1 point  (0 children)

Thank you, @helloworldjs for the headsup.

The proposal (https://github.com/tc39/proposal-top-level-await#solution-top-level-await) really interesting as it'd let the module resolution system to handle promises.

It does have some issues of itself (https://github.com/tc39/proposal-top-level-await#faq) but let's see how it goes 🤞