作用域链、函数执行上下文、全局执行上下文

function a(){
    function b(){
    function c(){}
    c();
    };
    b();           
}
a();

a defined -->a[[scope]]-->[0]:GO

a doing    -->a[[scope]]-->[0]:aAO

             [1]:GO

b defined -->b[[scope]]-->[0]:aAO

               [1]:GO

b doing   -->d[[scope]]-->[0]: bAO

              [1]:aAO

              [2]:GO

c defined -->c[[scope]]-->[0]:bAO

               [1]:aAO

            [2]:GO

c doing -->c[[scope]]  -->[0]:cAO

           [1]:bAO

           [2]:aAO

           [3]:GO

c over  -->b[[scope]]  -->[0]:bAO

           [1]:aAO

           [2]:GO

b over  -->a[[scope]]  -->[0]:aAO

           [1]:GO

a over  

     




原文地址:https://www.cnblogs.com/jokes/p/9197997.html