In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article shares with you the content of the sample analysis that JavaScript runs. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
1.1 grammatical analysis
Before precompilation, scan the whole text to see if there are any grammatical errors
1.2 precompiled 1.2.1 function declaration overall improvement
No matter where you write when declaring a function, it will promote the function as a whole to the front.
1.2.2 variable declaration promotion
Just promote var a; to the front, output the result as undefined, declare promotion
[xss_clean] (a)
Var axiom 123
1.2.3 imply global implies global variables
1. Definition: any variable that is owned by the global object (window) if it is assigned an undeclared value
Eg:a=10
-> window.a=10
The above code: var declares a, assigns values from right to left, first assigns 123 to b, and then to a, the result is that b is not declared, that is, it becomes a global variable window, printing window.b has a result 123 window. A has no result undefined.
two。 All declared global variables are attributes of window (global domain)
1.2.4 precompiled Quadrilogy (precompilation occurs just before the function is executed)
1. Create an AO object (Activation Object) active object (scope = executor context) with the global variable GO (global object==window)
two。 Find the parameter and variable declaration, use the variable and parameter name as the AO attribute name, and the value is undefined
3. Unify the actual parameter value with the formal parameter (not for global variables)
4. Find the function declaration in the function body, and the value is the function body.
Example 1:
Establish function
Where you have seen the precompilation, you don't have to look at it when executing the function. Here is the result of the function execution.
Example 2:
Print out 1pm 2pm 2 after the execution of the function.
Example 3:
Finally, when the function is finished, it turns an into 10.
Example 4:
1.3 interpretation and execution
Single thread, explain one line and execute one line
Thank you for reading! This is the end of this article on "sample Analysis of JavaScript Operation". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.