javascript 中 this 指向

JS 環境下的 this 指向於方法執行的上下文 上下文:上下級的代碼定義關係 var user = { fun1: function () { console.log(this) // fun1 的上下文是 user 對象,this 就是 user 對象 }, fun2: () => { console.log(this) //
相關文章
相關標籤/搜索