# function 函式帶參數 - 什麼是 函式帶參數: ``` // count = 函式名稱 // ()內表示要帶的數值 function count(oneNum) { var total = oneNum * 10; console.log('總數等於:' + total + '元'); } // count(10); // 執行結果: 總數等於:100元 ``` - 函式帶2個以上**參數**寫法: ``` // 函式名稱 // 參數1 , 參數2 function count(oneNum, twoNum) { var total = oneNum * 100 - twoNum * 5; console.log('一共是:' + total + '元'); } // 參數數值1 , 參數數值2 count(10, 5); // 1000 25 // Answer: 一共是:975元 ``` ###### 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