Expert Developer JavaScript Question: Download Expert JavaScript Developer PDF

Explain the role of deferred scripts in JavaScript?

Tweet Share WhatsApp

Answer:

By default, the parsing of the HTML code, during page loading, is paused until the script has not stopped executing. It means, if the server is slow or the script is particularly heavy, then the webpage is displayed with a delay. While using Deferred, scripts delays execution of the script till the time HTML parser is running. This reduces the loading time of web pages and they get displayed faster.

Download Expert JavaScript Developer PDF Read All 150 Expert JavaScript Developer Questions
Previous QuestionNext Question
What is the function of delete operator?Explain with an example the use of event handlers in JavaScript?