1.

Why shouldn’t JavaScript functions not be too long?(a) User friendliness(b) Tie up event loops(c) Browser becomes unresponsive(d) All of the mentionedI got this question in final exam.The above asked question is from Web Workers topic in chapter Caching, Debugging and Animation of JavaScript

Answer»

Right option is (d) All of the mentioned

Easy EXPLANATION: When JavaScript code RUNS for longer than a predefined amount of time than the browser shows a message of unresponsive SCRIPT. The client-side JavaScript functions must not RUN too long: otherwise, they will tie up the event loop and the web browser will become unresponsive to user INPUT.



Discussion

No Comment Found

Related InterviewSolutions