Lifetime of JavaScript Variables
- A JavaScript variable’s lifetime begins when it is declared.
- When the function is completed, the function (local) variables are erased.
- When you close a browser window, global variables are erased.
Javascript Scope
JavaScript Scope is the area where a variable (or function) exists and is accessible. We can layer the scope in a system which means the child scope can access the parent scope but not vice-versa.
Contact Us