# function() 函式的寫法 - function 寫法如下: ``` //宣告函式 //函式名稱 function testadd() { // 大括號裡面放入要執行的內容 console.log('妳好'); console.log('這是第一個函式練習'); } ``` - 重整網頁之後會發現什麼毛都沒有,這時候需要呼叫函式: ``` // 我們要在撰寫的函式之後,執行函式(); testadd(); // 執行結果: 妳好 這是第一個函式練習 ``` ###### tags: `JavaScript - 學徒篇`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up