Function Terminology
Terminology
- Function
- A reusable set of statements that take an (optional) input and return an (optional) output.
- Parameter
- A named variable that a function accepts as (eventual) input. Parameters are defined when the function is created.
- Argument
- The actual variable passed to a function when it is invoked.
- Invoking a Function
- Calling or running a function, using trailing parentheses
()
.
- First-class Function
- In Javascript, a function can be passed as a value like any other data type. They can be stored as a variable and be passed as an argument to another function.
- Callback function
- A function passed as an argument to another function to be invoked later.
Function fundamentals