Browser & Web Performance · Junior · Question 9 of 75
What's the difference between defer and async on a script?
- ✓Correct answer:
deferruns after parsing in document order;asyncruns as soon as it downloads, in any order - 2
asyncruns after parsing in document order;deferruns as soon as it downloads - 3They are the same;
asyncis just the newer name
Explanation
Both download without blocking the parser. defer suits app code that depends on order and the DOM; async suits independent scripts like analytics.