Re:V8 adds support for top-level await
by james-mcelwain on Tuesday September 24, 2019 @06:53PM
(#21065523)
Or my preferred (gross) version:
[ Parent
| on HN ]
Mine all tend to look like
(async () => {
// code
})().catch(console.error)Wow, I had completely forgotten the existence of void in JavaScript.
Why is it needed here? To force an expression without using the parentheses?
Edit: Yes, it seems so, and this usage with functions is explicitly documented there: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...