Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Learn how to get started with JS in the Web front end

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

How to learn the basic introduction to JS in the front end of Web, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.

Today, the editor will comb and summarize the basic knowledge points related to JS for you.

1. Domain chain:

When the code is executed in the environment, the scope chain of the variable object is created to ensure orderly access to all variables and functions that the execution environment has access to. The front end of the scope chain is always the variable object of the environment in which the code is currently executed.

2. Active object:

If the current execution environment is a function, the active object is used as a variable object.

3. Execution environment:

Sometimes called environment, it is one of the most important concepts in JavaScript. The execution environment defines other data that variables or functions have access to.

4. Variable object:

Each execution environment has a variable object associated with it, and all variables and functions defined in the environment are stored in this object.

5. Executable code:

1) Global code: for example, loading external JS files or code within local tags. Global code does not include code inside the function.

2) function code: code in function body

3) eval code: the eval () function evaluates a string and executes the JS code in it, such as eval ("alert ('helloworld')").

6. Execute context stack:

In a JS program, multiple execution contexts are bound to be generated, and the JS engine handles them as a stack, that is, the execution context stack.

7. Scope:

JS is a language without block-level scope (the curly braces code blocks of if, for and other statements or individual curly braces code blocks cannot form a local scope), so the formation of the local scope of js is formed by and only the code blocks defined in the function's curly braces, that is, the function scope.

8. Domain chain:

It is the implementation of scope rules, through the implementation of scope chain, variables can be accessed in its scope, and functions can be called in its scope.

The scope chain is an one-way linked list, and each node on the linked list is the variable object of the execution context. the head of the one-way linked list (the first node that can be accessed) is always the variable object (active object) of the function being called and the tail is always the global active object.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report