let data2 = {
address: 'New Delhi ',
pin: '201206',
details: () => {
return this.address + " " + this.pin
}
}
这里,当我调用data2.details()
时,输出是未定义的,但是当使用es5模式时,
let data2 = {
address: 'New Delhi ',
pin: '201206',
details: function () {
return this.address + " " + this.pin
}
}
它运作正常吗?