特牛网址导航

构造函数中,this的指向_构造函数中this指向-CSDN博客

网友收藏
文章浏览阅读2.3k次。首先,我们知道,构造函数(Constructor)中的this指向调用该构造函数所创建的实例对象(instance)。但是,但我们在构造函数中定义一个隐形全局变量 that = this 的时候,并用该构造函数创建多个实例对象,那么这个变量that会指向哪一个实例对象呢? function Constructor() { that = this; ..._构造函数中this指向