Computer Science, asked by aisha6565, 9 months ago

Explain JavaScript Variable Scope with example

Answers

Answered by Hɾιтհιĸ
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 kajalbadreshiya28
0

Explanation:

scope of JavaScript variable with exampel

Similar questions