前端-第15天-作业

2018-11-04  本文已影响6人  看三小

<!DOCTYPE html>
<html lang="en"><head>
<meta charset="UTF-8">
<title>闭包</title>
<script type="text/javascript">

    function aa(b){
        var a = 12;

        function bb(){
            alert(a);
            alert(b);
        }

        return bb;
    }

    var cc = aa(24);*/

    var cc = (function(b){
        var a = 12;

        function bb(){
            alert(a);
            alert(b);
        }

        return bb;
    })(24);

    cc();
    (function(b){
        var a = 12;

        function bb(){
            alert(a);
            alert(b);
        }

        return bb;
    })(24)();
    */
</script>

</head>
<body>

</body></html>

上一篇下一篇

猜你喜欢

热点阅读