To pass information to a function, you can use parameters (also known as arguments). As shown in previous examples, not all functions need to have parameters. Each parameter has a name and are assigned to particular values when the function is called. Parameters change the function behavior depending on the values that are passed. There parameters can be of any type, Number
, String
, Object
, Array
, Function
, etc. There are no limits to how many parameters a function can have.
To call a function and pass values to its parameters, we use the function's name, followed by a list of expressions for each parameter. These parameters belong inside the set of parenthesis that come after the function's name.