What ? (are these)Basically async and defer are attributes that can be used by <script> to improve page speed by decreasing loading lag.Why? (do we use)We add this attribute to script tag in HTML to control script loading and executing.How? (it works)async : This attribute tells browser to download script file asynchronously while continuing to parse the HTML page. Once script has downloaded it executes immediately regardless page parsing.defer : This attribute also tells browser to download script file asynchronously while continuing to parse the HTML page. Name is self-evidently, it defers execution of script until HTML page has finished…
Stay ahead in the world of tech with our exclusive newsletter! Subscribe now for regular updates on the latest trends, valuable coding resources, and tips to boost your frontend development skills.