+ 1
Differences between parameter & argument? Please.
What is the differences between both?
4 Respuestas
+ 14
Parameters are the values that a function asks for. Ex:
def example(x, y) #Wants/has 2 parameters, x and y.
Arguments are the values themselves, that are sent to a function.
example(17, 15) #Sends 2 arguments, 17 and 15.
+ 12
Parameter is variable in the declaration of function/method
Argument is the actual value of this variable that gets passed to function/method
https://stackoverflow.com/a/156787
+ 6
void func(int a){} - a is parameter
func(5) - when call func , 5 is argument
+ 5
function Hello(a,b)
{ alert(a+b);}
a and b are the parameters for the function,they have no values yet.
Hello(5,8);
5 and 8 serve as values for a,b they are arguments
//output 5+8==13