Module Maze · Level 8 of 8

Top-level await holds the importer

config.mjs awaits a timer at the top level. main.mjs imports it.

main.mjs
import { config } from './config.mjs';console.log('main runs with ' + config);
config.mjs 4 lines
console.log('config: loading');await new Promise((r) => setTimeout(r, 20));export const config = 'ready';console.log('config: done');

1. Predict the output

Tap the lines in the order you think they print.

  1. 1…
  2. 2…
  3. 3…