JavaScript this运用
-
函数预编译过程 this —> window
函数预编译中this --> window ,当new 一个对象是 函数内的this 改变指向, this --> 新建的对象
![]()
-
this--> 新建的对象 -
全局作用域里
this—>window -
call/apply可以改变函数运行时this指向 -
obj.func();func()里面的this指向obj;
谁调用
this指向 谁;
2.arguments
两个属性
-
callee
作用:指向函数的引用
注意:谁调用就指向谁
返回结果分别为test ,demo 的指向。
-
length
数组长度


浙公网安备 33010602011771号