First question
is actually the concept of variable ascension
var A;
if (! (' A ' in window)} {
A = 1;
}
Console.log (a);
second question
This is where the function declaration overrides the variable declaration, even if the function declaration is written behind the variable declaration. is overwritten, but the function expression is not overwritten.
Third question
The section of the variable object in the context of a function makes it clear that the active object is created at the moment of entry into the function context and is initialized by the arguments property of the function. The value of the arguments property is the arguments object:
The arguments object is a property of the active object, and it includes the following properties:
- callee- A reference to the current function arguments.callee.length is the number of formal parameters you can also use the function name. length; in fact funname.length = = = Arguments.callee.length;
- length- True number of arguments passed
- The value of the Properties-indexes (integer of String type) property is the parameter value of the function, arranged from left to right in the argument list. Properties-indexes the number of internal elements is equal to arguments.length. The value of properties-indexes is shared with the actual passed in parameters.
This share actually does not really share a memory address, but 2 different memory addresses, using the JavaScript engine to ensure that 2 values are always the same, of course, there is a premise, that is, the index value is less than the number of parameters you passed in, that is, if you only pass in 2 parameters, and continue to use arguments[2] to assign values, it will be inconsistent, for example:
Question Fourth
According to the ECMASCRIPT262 specification, the call method takes the global object (that is, window) as the value of this if the caller of the first parameter passed in is null or undefined. So, no matter when you pass in NULL, its this is the Global object window. If it is alert (this); Is ' [Object Window] ';
Do you really know javascript?