JS基礎之caller

函數對象.caller,返回當前函數的函數引用。因爲outer()調用了inner(),所以inner.caller指向outer() function outer() { inner(); //這會顯示嗎 } function inner() { alert( inner. caller); //不能寫成alert(this.caller); //否則會顯示undefined } outer()
相關文章
相關標籤/搜索