【文件属性】:
文件名称:javaScript中的this指向 (2).md
文件大小:1KB
文件格式:MD
更新时间:2020-02-23 23:43:45
this指向 js中的this
js中的this指向的几种具体情况:
1.通过函数名直接调用,this指向window;
2.函数作为window内置函数的回调函数调用,this指向window;
3.通过对象调用函数,this指向这个对象;
4.函数作为构造函数,this指向新new出的对象;
5…利用apply、call改变this指向