Question #118

Author: admin
tags: JavaScript  
html:
<script type="module" src="main.js"></script>
main.js:
console.log('start');
import { func1 } from './module.js';
console.log('middle');
import { func2 } from './module.js';
console.log('end');
module.js:
console.log('module');
export function func1() {}
export function func2() {}
In what order will the text be printed to the console?
module, start, middle, end
start, middle, end, module
start, middle, end
start, module, middle, module, end
start, module, middle, end
start, middle, module, end
module, module, start, middle, end
The module code is executed only once.
The module code is executed before the code where it is imported.
Rate the difficulty of the question:
easyhard