Understand variable objects in js in this way
This article mainly explains "so understand the variable object in js", the content of the explanation in the article is simple and clear, easy to learn and understand, now please follow the editor's train of thought slowly in depth, together to study and learn "so understand the variable object in js"!
1. The variable object is the data scope related to the execution context. It is a special context-sensitive object that stores variables and function declarations defined in the context.
2. Variable object is an abstract concept. Different context types physically use different objects.
Example
Var foo = 10; function bar () {} / / function declaration, FD (function baz () {}); / / function expression, FE console.log (this.foo = = foo, / / true window.bar = = bar / / true); console.log (baz) / / ReferenceError, "baz" is not defined Thank you for your reading, the above is the content of "this understanding of variable objects in js". After the study of this article, I believe you have a deeper understanding of the problem of understanding variable objects in js, 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!