<html> <head> <title>wodeweb</title> </head> <body> <script type="text/javascript"> for(var i=0;i<5;i++) { var num=20; //在JavaScript中除了全局环境和函数环境, //其他情况下即使变量声明在一对大括号中,在括号外仍然 //可以访问这些变量,对于异常语句也同样可以 } alert(num); </script> </body> </html>