在Javascript中,
this对象实际上是基于如何进行函数调用的。
通常,有三种方法可以设置
this对象:
someThing.someFunction(arg1, arg2, argN)
someFunction.call(someThing, arg1, arg2, argN)
someFunction.apply(someThing, [arg1, arg2, argN])
在上述所有示例中,
this对象均为
someThing。在没有前置父对象的情况下调用函数通常会为您提供 全局
对象,这在大多数浏览器中都意味着该
window对象。



