this好神秘,我还是先引用一段英文吧
"this" is a keyword not a property of any object, that refer to one object depending on the scope. In the global scope, it refers to the window object. In the function scope it refers to the object that has the function as its property
这句话大体是说,this不属于任何对象,当他是全局变量时候,他指的是window对象,当他是函数【也可说对象】范围内时候,是指向这个函数【对象】
评论