Skip to content

QuizNot attempted

Module scripts

How does <script type="module" src="app.js"> in the head behave?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • Downloads in parallel and runs after the document is parsed, like defer
  • Module scripts are deferred by default: they download in parallel and execute after parsing, in order (and get strict mode, import, their own scope).
  • Not parser-blocking: only classic scripts without defer/async block.
  • Not like async: only if you add async to the module.
  • Not after window.onload: deferred scripts run before DOMContentLoaded, well before load.