小闭包(参数传参)

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<script>
    (function(a,b){
        var num = 10;
        console.log(a+b+num);
    }(1,2));
     (function(a,b){
         var num = 20;
        console.log(a+b+num);
    }(4,5));
</script>
</body>
</html>

posted @ 2015-08-06 23:26  花神华安  阅读(236)  评论(0编辑  收藏  举报