- 函数预编译过程中this指向window(全局)
function test(c){
var a = 123;
function b(){}
}
test(1);
AO{
arguments:[1],
this : window,
c : 1,
a : undefined,
b : function(){}
}
- 全局作用域(GO)中this指向window
- call/apply可改变函数运行时的this指向
- object.function() function()中的this指向object
var obj = {
a : function(){}
}
obj.a()
//此时a()中的this指向obj