1. 程式人生 > >JS函式執行

JS函式執行

函式定義:

    function name(){

        #內容

}

    普通函式:

        function name(){

        #內容

}

    匿名函式:

        setInterval(function(){

            #內容

},5000)                        #setInterval 是隔一段時間執行一次

    自執行函式:

        (function(arg){

            console.log(arg);

)(1)                                   #console.log()  在網頁編輯器裡顯示內容