aboutsummaryrefslogtreecommitdiff
path: root/files/zh-tw/glossary/parameter/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-tw/glossary/parameter/index.html')
-rw-r--r--files/zh-tw/glossary/parameter/index.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/files/zh-tw/glossary/parameter/index.html b/files/zh-tw/glossary/parameter/index.html
new file mode 100644
index 0000000000..0cd6c5abfd
--- /dev/null
+++ b/files/zh-tw/glossary/parameter/index.html
@@ -0,0 +1,38 @@
+---
+title: 參數
+slug: Glossary/Parameter
+translation_of: Glossary/Parameter
+---
+<p>參數 (parameter) 是個會傳進函式 ({{Glossary("function")}}) 的已命名變量,用來把引數 (({{Glossary("argument","arguments")}})) 導入到函式中。</p>
+
+<p>要特別注意參數和引數的差異:</p>
+
+<ul>
+ <li>函式參數的名稱會在函式的定義區裡面條列出來。</li>
+ <li>裡面的引數都是實值,會導入函式中。</li>
+ <li>參數一開始的值就跟有提供的引數值一模一樣。</li>
+</ul>
+
+<p> 一般而言,參數的形式有兩種表示方式:</p>
+
+<dl>
+ <dt>輸入用的參數</dt>
+ <dd>像這樣藉由值呼叫的形式最常見。此外,還可以根據不同的程式語言,讓輸入用參數的使用模式多樣,例如:用值呼叫 (call-by-value)、用位置呼叫 (call-by-address) 和完成函式程序後把它的值設定成回傳值 (也就是 call-by-reference)。</dd>
+ <dt>輸出和回傳 (return) 用的函數</dt>
+ <dd>在函式的程序完成之後,會負責回傳多重的量值。不過,這方式可能會讓程式開發者誤解它的意思,所以不建議使用。</dd>
+</dl>
+
+<h2 id="想了解更多嗎?">想了解更多嗎?</h2>
+
+<h3 id="一般常識篇">一般常識篇</h3>
+
+<ul>
+ <li><a class="external external-icon" href="http://en.wikipedia.org/wiki/Parameter_%28computer_programming%29#Parameters_and_arguments">Difference between <em>parameter</em> and <em>argument</em></a> on Wikipedia</li>
+</ul>
+
+<h3 id="技術參考">技術參考</h3>
+
+<ul>
+ <li><a href="/en-US/docs/Web/JavaScript/Reference/Statements/function">Function declaration</a></li>
+ <li><a href="/en-US/docs/Web/JavaScript/Reference/Operators/function">Function expression</a></li>
+</ul>