Description and use of javascript scope
This article mainly explains "the description and use of javascript scope". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the description and use of javascript scope".
Description
1. The scope can be understood as the current execution context, and note that it is current.
2. The scope itself does not have the values of variables and methods, but only in the corresponding execution context, that is, variables in different execution contexts will have different values.
Scopes also have subordinate relationships, determining the scope under which a function or variable is created.
Example
Var age = 10 function test () {var age = 100; console.log (age);}; test (); / 100 Thank you for your reading, the above is the content of "description and use of javascript scope". After the study of this article, I believe you have a deeper understanding of the description and use of javascript scope, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!