Js中的this

1.全局的this 全局作用域上的this等於window 2. 一般函數的this 以下是一般模式和嚴格模式的區別。注意:global object針對的是nodejs。 3. 對位對象方法的函數的this(常用) 左邊:函數作爲對象的屬性,this指向對象o,console.log實際上指的o.prop,所以輸出37。 右邊:在function indepemdent(){return thi
相關文章
相關標籤/搜索