Script defer vs async

The points above is why you should not depend on async if: It changes something in the DOM
Nowadays, the optimization of the loading times of your web page is very important in many aspects
Generally, the async attribute should be used for scripts that are not critical to the initial rendering of the page and do not depend on each other, while the defer attribute should be used for scripts that depend on / is depended on by another script
Jun 3, 2023 · The async and defer attributes are boolean attributes that indicate how the script should be evaluated
/body>