在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ [About JS]How to get obj's property in s

[About JS]How to get obj's property in such a situation?

For Example:

var o = {
  x: 10,
  handleX: () => {
    // I want to get x here, and then...
    console.log(this.o.x) // 這不是我想要的結(jié)果
  }
}
回答
編輯回答
不二心
var o = {
  x: 10,
  handleX() {
    console.log(this.x)
  }
}
2018年4月25日 02:14