1.

Which of the following functions are referenced internally?(a) setTimeout(b) setInterval(c) both setTimeout and setInterval(d) clearIntervalThis question was addressed to me in exam.This key question is from JavaScript and Memory Leak in section Caching, Debugging and Animation of JavaScript

Answer»

Right choice is (c) both setTimeout and setInterval

Easiest explanation: setTimeout(function, milliseconds) EXECUTES a function, after waiting a specified number of milliseconds. FUNCTIONS USED in setTimeout/setInterval are REFERENCED INTERNALLY and tracked until complete, then cleaned up.



Discussion

No Comment Found

Related InterviewSolutions