ExamVeda
Login
Home
This question belongs to Javascript Caching And Debugging
Caching and Debugging
?

What is the purpose of destroying the functions and objects?

Answer & Solution
Correct Answer: Option D
The primary purpose of a destroy function is to centralize the responsibility for cleaning up anything that the object has done that will:
1. Prevent its reference count from dropping to 0 (for example, removing problematic event listeners and callbacks and unregistering from any services).
2. Consume unnecessary CPU cycles, such as intervals or animations.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.