Imports go first
In main.mjs, a console.log sits above the import. Which runs first?
main.mjs
console.log('main top');import { hello } from './lib.mjs';console.log(hello);lib.mjs 2 lines
console.log('lib.mjs body');export const hello = 'hello from lib';1. Predict the output
Tap the lines in the order you think they print.
- 1…
- 2…
- 3…