Browser & Web Performance · Junior · Question 26 of 75
Why does heavy JavaScript make a page feel slow even after it has loaded?
- 1Browsers download JavaScript again on every click
- 2JavaScript always runs on the GPU and competes with images
- ✓Correct answer: JavaScript runs on the main thread, which also handles input and rendering, so long scripts delay both
Explanation
Splitting work into smaller tasks, deferring non-critical code and moving heavy computation to workers keeps the main thread free.