码迷,mamicode.com
首页 > 其他好文 > 详细

ErrorCode_将函数作为参数的连续嵌套

时间:2020-07-10 20:45:24      阅读:53      评论:0      收藏:0      [点我收藏+]

标签:var   console   com   OLE   png   ror   error   fun   不能   

        function a(arg) {
            console.log(‘this is a‘);
            arg();
        }

        function b(arg) {
            console.log(‘this is b‘);
            arg();
        }

        function c(arg) {
            console.log(‘this is c‘);
            arg();
        }

        function d() {
            console.log(‘this is d‘);
            console.log(this.e);
            
        }
        var e = 77;
        a(d);
        console.log(‘-------‘);
        a(b(c(d)));

技术图片

函数作为参数的连续嵌套调用是不可维持的,原因是第二个函数作为参数是已经被调用的函数了,不能再次被调用

ErrorCode_将函数作为参数的连续嵌套

标签:var   console   com   OLE   png   ror   error   fun   不能   

原文地址:https://www.cnblogs.com/Syinho/p/13280903.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!