Parameters are named variables declared as part of a function. They are used to reference the arguments passed into the function.
For example:
const argument1 = "Web";
const argument2 = "Development";
example(argument1, argument2); // passing two arguments
// This function takes two values
function example(parameter1, parameter2) {
console.log(parameter1); // Output = "Web"
console.log(parameter2); // Output = "Development"
}
There are two kinds of parameters:
the most common kind; they pass values into functions. Depending on the programming language, input parameters can be passed in several ways (e.g., call-by-value, call-by-address, call-by-reference).
primarily return multiple values from a function, but are not recommended since they cause confusion
Note the difference between parameters and arguments:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4