-- This starts with the JAVASCRIPT interpreter: every time the JAVASCRIPT interpreter starts to execute a function, it creates an execution environment, in addition, a variable object that is closely related to this function will be generated, and all variables or functions defined in this execution environment will be saved by it. But he is like a related department and may be closely related to you, but you can never find him, and you cannot call this object, however, the JAVASCRIPT parser calls it when processing data.
So far, let's talk about the execution environment. Starting from the global execution environment, it is in the outermost area of the entire execution environment and is added as a property of the window object.
For example:
Copy codeThe Code is as follows:
<Html>
<Head>
<Script type = "text/javascript">
Var a = 1;
(Function (){
Alert (window. a === );
})();
</Script>
</Head>
<Body>
</Body>
</Html>
True is displayed at the end of this example. That is to say, the global variables we define at the periphery are finally compiled into windows. After all the code in an execution environment is executed, all the variables and function definitions in the environment will be taken down and destroyed. The rabbit who eats the fruit.
However, Javascript allows multiple global execution objects. Nana ?! Yes, it's a bad chestnut: IFRAME, the owner of IFRAME is different from the global environment of the window. Of course, if cross-origin attribute retrieval is involved here, we need to talk about security. Well, Click till now. That's all.