次世代 Hugo

智能を研ぎ、創造を編む

ECMAScript 之 Scope Chain

因為 ECMAScript 支援 First-class Function,因此可在 Function 內定義其他 Function,當 Function 內找不到 Variable 時,會先在 Function 內尋找,若找不到則往 Function 外層尋找,最後才會到 Global 尋找,此稱為 Scope Chain。