News for hackers. Stuff that matters.
Re:V8 adds support for top-level await by tlrobinson on Wednesday September 25, 2019 @12:51AM (#21067705)
I would have written it in a more functional way:

  async function totalSize(fol) {
    const files = await fol.getFiles();
    const sizes = await Promise.all(files.map(file => file.getSize()));
    return sizes.reduce((acc, size) => acc + size);
  }

There are no comments on this comment yet.