Get the App
SLTechnology News&Howtos  ›  Development  › 

Understand variable objects in js in this way

Shulou Source: shulou.com Published: 2022-06-02 20:34:23 10月25日 Update

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!

Tags: Objects variables up and down context learning differences content special functions functions examples that is ideas situations data articles more concepts physics knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MySQL MariaDB Shulou Tech Info Microsoft