首页 > 其他 > 详细

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

时间:2018-06-19 12:51:07      阅读:237      评论:0      收藏:0      [点我收藏+]
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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!