3)嵌套函数 例 3.3.1 <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> </head> <script> function outerFun(){ var i = 0; function innerFun(){ document.write(i); } innerFun(); } outerFun(); /*here you can not call innerFun(), because it is inside another function outerFun, so it will cause error.*/ innerFun(); document.write("马克-to-win"); </script>
更多请见:https://blog.csdn.net/qq_44594249/article/details/99978852