2018.9.13日记

1.立即执行函数 

https://blog.csdn.net/qq_34391038/article/details/52318356 

 getajax = (function(){

        alert("hello");

        function dosomething(){

            alert("world");

        }

        return {do : dosomething};

    })();//此处函数已经执行完毕,所以getajax是返回值,而不是函数

    getajax.do();//此处执行dosomething函数


猜你喜欢

转载自blog.51cto.com/13968096/2174635
今日推荐