Defer parsing of JavaScript is like deferring JavaScript that we discussed in the previous section. For a web page to load, all the script contents must be parsed, or analyzed, and then built within the DOM tree. Obviously, the more JavaScript you have on a page, the longer this is going to take, which affects performance. So, developers have options, like the defer and async attributes, at their disposal to help improve response times and run JavaScript when, or where, necessary.
Again, this is especially important for mobile devices. The sooner the user can interact with your page, the longer you can keep them on your site instead of them having to be met with a page loading icon. To understand whether a specific page may need to defer parsing of JavaScript, run your page through a website speed test and review the specific recommendations. A quick review of your page’s performance can make all the difference to the user’s experience.