parameter와 argument의 차이
<parameter와 argument의 차이점>
function 정의 할때 괄호 안에 적는 변수의 이름이 function parameter이다.
function argument는 function을 통해서 전달되는 실제 값들이다.
parameter는 argument가 공급된것의 값으로 초기화 된다.
Example)
// addend1, addend2는 parameter
function sum(addend1, addend2){
return addend1 + addend2
}
// sum()로 runtime에서 넘기는건 argument
let value1 = 40;
let value2 = 2;
let sumValue = sum(value1, value2);
parameter는 변수고, argument는 literal이나 다른것들이 올수 있다
대략적으로, parameter는 type이고 argument는 instance이다.
출처 :
https://developer.mozilla.org/en-US/docs/Glossary/Parameter
Parameter - MDN Web Docs Glossary: Definitions of Web-related terms | MDN
A parameter is a named variable passed into a function. Parameter variables are used to import arguments into functions.
developer.mozilla.org
https://en.wikipedia.org/wiki/Parameter_%28computer_programming%29#Parameters_and_arguments
Parameter (computer programming) - Wikipedia
From Wikipedia, the free encyclopedia Jump to navigation Jump to search An input provided to a function/subroutine In computer programming, a parameter or a formal argument is a special kind of variable used in a subroutine to refer to one of the pieces of
en.wikipedia.org