http://jsbin.com/qeleboyeme/1/edit?js,consolevara={apple:{apple1:"ap1",apple2:"ap2"},banana:{banana1:"ba1",banana2:"ba2",//banana3:a.apple.apple1,banana4:this.banana1,},pear:function(){console.log(this.banana.banana1);}};console.log(a.banana.banana1);console.log(a.banana.banana2);console.log(a.banana.banana3);console.log(a.banana.banana4);a.pear();//a.banana想取a.apple里面的值怎么办?如题,a.banana想取a.apple里面的值怎么办?pear中的this指向的是a,banana4中的this指向的是global如果把banana3那里的注释去掉会直接报错
添加回答
举报
0/150
提交
取消