第一个js库文件

时间:2021-10-21 13:40:51
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>js lever</title> <script type="text/javascript">
    var testModult =(function(){
        var counter = ;
        return {
                    incrementCounter:function()
                    {
                        return ++counter;
                    },
                    resetCounter:function(){
                        console.log("counter value prior to reset: "+counter);
                        counter=;
                    }
                };
    })();
    testModult.incrementCounter();
        testModult.resetCounter();
</script>
</head>
<body>
</body>
</html>