new一个对象将会发生的事情

    技术2024-04-02  94

    foo = "bar" function testThis(){ this.foo = 'foo'//this为testThis这个函数(对象) } console.log(this.foo);//bar new testThis();//创建了一个对象,该对象的foo = 'foo', console.log(this.foo);//bar console.log(new testThis().foo)//foo
    Processed: 0.013, SQL: 10