What are arguments and why should I care?
In programming, an argument does not have anything at all to do with with loud voices or disagreement.
In programming an argument is something that is sent as input to a function call
The stuff you see between the parentheses in a function call is the arguments. The arguments is received by the function and will determine the way that the action of the function is carried out.
Let's try it out
Type the following into the the box where it says Enter source code here:
Click Check source code.
So what is happening here?
The functions turnOn() and turnOff() are taking one argument each - a number identifying the lamp to turn on and off respectively. When called, the functions will turn on or off the lamp given by the argument.
Now, for fun. Try this: