js this 詳解

this詳解  你可能遇到過這樣的 JS 面試題:javascript { var obj = { foo: function () { console.log(this) } } var bar = obj.foo obj.foo(); // 打印出的 this 是 obj bar(); // 打印出的 this 是 window }  這個緣由是由於「Javascript中t
相關文章
相關標籤/搜索