Closed twy30 closed 4 years ago
之前有做過筆記:
Parameters: 參數 Arguments: 引數
A parameter is a variable in a method definition. When a method is called, the arguments are the data you pass into the method's parameters. Parameter is variable in the declaration of function. Argument is the actual value of this variable that gets passed to function.
Parameters are used to define a function. They are also called formal parameters and formal arguments.
function foo(param1, param2) {
...
}
param1 and param2 are parameters
Arguments are used to invoke a function.
They are also called actual parameters and actual arguments.
foo(3, 7)
3 and 7 are arguments:
--
補充一點資料 😊
late 1920s when it began to be extended to "measurable factor which helps to define a particular system,"
parameter 在 1920 年代晚期開始含有「用來定義一系統的『可測量因子』」
洋鄉民討論「為什麼引數要叫 "argument" ?」;有人從語源學的角度回答,大意是:
https://www.etymonline.com/word/argument#etymonline_v_26509 from arguere "make clear, make known, prove"
如果覺得還有問題、疑慮,歡迎再開新 issue 來討論 😊
https://github.com/EngTW/English-for-Programmers/issues/25#issuecomment-664709204