Expert Developer JavaScript Question:
Download Questions PDF

Explain the role of deferred scripts in JavaScript?

Expert JavaScript Developer Interview Question
Expert JavaScript Developer Interview Question

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 Interview Questions And Answers PDF

Previous QuestionNext Question
What is the function of delete operator?Explain with an example the use of event handlers in JavaScript?