During the traversing of the stack when you create a locally scoped variable, where does it go after it goes to the namespace?

Ngân Lam

New member
During the traversing of the stack when you create a locally scoped variable, where does it go after it goes to the namespace?
A. Window
B. Function
C. Document
D. Location
 
Answer: b
Explanation: Namespace in JavaScript is nothing but a single global object which will contain all our functions, methods, variables and all that. When you create a locally scoped variable for caching the reference, the traversal reverses in the forward direction and thus, after going to the namespace, it goes to the function.
 

Tìm kiếm

Back
Top