This反正是關係到this保持跟蹤同一功能的多個運行中,第2部分
我需要的其實是一些稍有不同,我需要這樣的一些方法:
function run(arg) {
this.ran = this.ran || false;
if (!this.ran) init;
/* code */
this.ran = true;
}
該作品好,我只是想確保這個代碼工作,即使當this
的情況下,它被稱爲call()或申請()
檢查this爲我所說的,所有的電話af第一個應該都是真的,不管上下文如何
Doesnt my [answer這裏](http://stackoverflow.com/questions/4893656/how-can-i-keep-track-of-multiple-runs-of-the-same-function/4893989#4893989)在你的其他問題處理這個? – 2011-02-04 07:16:31
刪除我的答案,因爲您的原始問題包含完全相同的解決方案。 – Anurag 2011-02-04 07:50:36