Why shouldn’t JavaScript functions not be too long?

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 mentioned
 
Answer: d
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.
 

Tìm kiếm

Back
Top