-
All variable declarations, will be raised to the very top, but not improve assignment
-
All function declarations, will be raised to the very top, but will not improve the calling function
-
If there is a plurality of identical variable declarations var while the latter will be ignored var
-
If there is a function of the same name at the same time, the latter function will overwrite the previous functions
-
If the function of the same name and variable declaration statements, function declarations will override the variable declaration
-
-
Analysis of the first function parameter (the default is undefined), and then analyzed assignment parameter (parameter not directly ignore this step)
-
Analysis of all the variables declared in the function body:
2.1 If the parameter variable name and the names are the same, ignore var;
2.2 If the parameter name and the variable name is not the same, equivalent declare a variable, such as var foo, is undefined;
-
Analysis of all functions declared in the function body,
3.1 If the same function names and variable names, function as the overall value of the variable;
3.2 If the function names and variable names are not the same, corresponding to the function name var function name = function () {};
Function is being executed is divided into two steps:
-
Lexical analysis process;
-
Implementation process
-