function haha(){ this.one=function(){
console.log(this)
} this.two=function(){
this.one(); console.log(this)
}
}var hehe = new haha()
hehe.two()通過對象的屬性調用,this不是應該指向這個對象的嗎(hehe對象)?為什么這里會輸出兩個haha對象呢.
一個奇怪的this指向問題
慕尼黑5688855
2018-09-11 09:26:47