Explain the working of timers in JavaScript? Also elucidate the drawbacks of using the timer, if any?
Answer / Subhankar Dey
JavaScript timers are functions that execute after a specified delay or at regular intervals. The most common timers are setInterval() and setTimeout(). Timers are useful for creating animations, repeated tasks, and AJAX requests. However, excessive use of timers can lead to performance issues, as they may cause the browser to consume more CPU resources.
| Is This Answer Correct ? | 0 Yes | 0 No |
Is javascript a security risk?
What are the ways of making comments in javascript?
What is use of settimeout function in javascript?
What is the use of ‘debugger’ keyword in javascript code?
What are the different functional component in javascript?
What do you understand by this keyword in javascript?
What is the use of a map object in javascript?
What is null in programming?
How much do javascript programmers make?
What javascript method would convert the string “20” to an integer (on the fly) so “20” + 20 = 40?
What is ‘this’ keyword in JavaScript?
Why typeof null is object?