News for hackers. Stuff that matters.
Re:V8 adds support for top-level await by james-mcelwain on Tuesday September 24, 2019 @06:53PM (#21065523)
Or my preferred (gross) version:

    void async function main() {
       // code
    }()
Re:V8 adds support for top-level await by elyobo on Tuesday September 24, 2019 @07:14PM (#21065704)
Mine all tend to look like

  (async () => {
    // code
  })().catch(console.error)
Re:V8 adds support for top-level await by jraph on Tuesday September 24, 2019 @07:16PM (#21065723)
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...

Re:V8 adds support for top-level await by ericlewis on Tuesday September 24, 2019 @10:31PM (#21067013)
Yep. Exactly why. Seems silly since it doesn’t really care for types in the first place.