Vidyalelo
JavaScript · Q4

Caching And Debugging

Programming · JavaScript · question 4

Q4

Why do we need to create locally scoped variables to hold value?

A.
To optimize the testing process
B.
To increase the speed
C.
To minimize memory usage
D.
To cache the reference document.location
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
The locally scoped variables are created to cache the reference to document.location.