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

Correct Answer: All of the mentioned

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.

Related Questions

What looks for people on the network who shouldn't be there or who are acting suspiciously?
Do functions in JavaScript necessarily return a value ?
Why was “The Good Parts” designed as a language subset in JavaScript?
Why does JavaScript subset disallow == and !=?
Why is the this keyword forbidden in JavaScript?

Next steps