this

mac2022-06-30  101

this

 指的是当前对象

 关键词,不能作为变量名

 只能读不能写,他的值只能用,不能修改

函数外用

 this指向的是window

函数内用

 函数是被直接调用的,this指向window

 被事件所调用,并以赋值的形式出现,谁调用了函数,this就指向谁

转载于:https://www.cnblogs.com/7-Eleven/p/5781129.html

最新回复(0)