JS匿名函数&闭包
<html>
<head>
<title>
test
</title>
</head>
<body>
<script type="text/javascript">
(function (){
//局部变量
var a=1;
var b=3;
alert(a+b);
})();
//undefinded
alert(a);
</script>
</body>
</html>
每一天都是崭新的

浙公网安备 33010602011771号