1. function test1() {
    2. function test2() {
    3. var b = 2;
    4. console.log(a); // 1
    5. }
    6. var a = 1;
    7. return test2;
    8. }
    9. var c = 3;
    10. var test3 = test1();
    11. test3()

    test1 定义 :test1.scope->0:GO
    test1 执行:test1.scope->0:test1.AO
    1:GO
    test2定义:test2.scope->0:test1.AO
    1:GO
    test1结束:test1.scope->0:GO
    test1函数先结束,return了,函数肯定执行完成,test1.AO的地址删除,只有GO的地址

    test3(test2) 执行:test2.scope->0:test2.AO
    1:test1.AO
    2:GO
    test3结束:test2.scope->0:test1.AO
    1:GO