Skip to content

QuizNot attempted

defer vs async

Which statement about <script defer> vs <script async> is correct?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • Both download in parallel; defer runs in document order after parsing, async runs as soon as it downloads (order not guaranteed)
  • Both attributes download without blocking the parser
  • defer runs after parsing finishes, in document order, while async runs as soon as its download completes, in whatever order they arrive.
  • Not 'async keeps order': backwards.
  • Not 'defer blocks parsing': that is a plain <script>.
  • Not identical: order and timing differ.
  • Use defer for app code, async for independent scripts like analytics
  • type="module" is deferred by default.