Vidyalelo
JavaScript · Q5

Document Object Model And Event Handling

Programming · JavaScript · question 5

Q5

Which method receives the return value of setInterval() to cancel future invocations?

A.
clearInvocation()
B.
cancelInvocation()
C.
clearInterval()
Answer
D.
None of the mentioned

Answer: Option C

Solution

Answer: Option C
Solution:
Like setTimeout(), setInterval() returns a value that can be passed to clearInterval() to cancel any future invocations of the scheduled function.