Parameter
beginnerDefinition
A variable listed in a function's definition that acts as a placeholder for data the function will receive when it's called. Parameters let you write one function that works with many different inputs instead of hard-coding specific values.
In the wild
In function calculateTip(billAmount, tipPercent), 'billAmount' and 'tipPercent' are parameters. When you call calculateTip(50, 20), the number 50 fills in for billAmount and 20 fills in for tipPercent.
More from Programming Basics
Function
A reusable block of code that performs a specific task. You give it a name, and whenever you need that task done, you 'call' the function by name instead of writing the same code again. Functions can accept inputs and produce outputs.
Return Value
The output a function sends back to the code that called it. When a function reaches a 'return' statement, it stops running and hands back that value. The calling code can then store it in a variable, display it, or pass it to another function.
Variable
A named container that holds a value in your program. Think of it like a labeled box: the label is the variable's name, and inside is the data (a number, some text, a list, etc.). You can read what's inside, replace it, or use it in calculations.