Explain JavaScript Variable Scope with example
Answers
Answered by
10
JavaScript has two scopes – global and local. Any variable declared outside of a function belongs to the global scope, and is therefore accessible from anywhere in your code. Each function has its own scope, and any variable declared within that function is only accessible from that function and any nested functions.
Answered by
0
Explanation:
scope of JavaScript variable with exampel
Similar questions