當即執行函數

當即執行函數是表達式,只在括號內可見。   例一 括號內可見函數   var times = 0; (function hello(){ console.log('hello~'); ++times<2&&hello(); })();     例二 括號外不可見spa   (function hello(){ console.log('~hello'); }); console.log(hello
相關文章
相關標籤/搜索