Parameters
Also known as: arguments, inputs
Named values passed into a function when calling it, allowing the same function to operate on different data. Transforms a function from doing one thing to doing many related things.
๐ก Intuition
The blanks you fill in when using a function. Like a form with fields.
Core Idea
Parameters make functions flexibleโsame code, different data.
๐ฌ Example
๐ฏ Why It Matters
Transforms a function from doing one thing to doing many related things.
โ ๏ธ Common Confusion
Parameter (in definition) vs. argument (in call)โoften used interchangeably.
Related Concepts
Prerequisites
Next Steps
How Parameters Connects to Other Ideas
To understand parameters, you should first be comfortable with function. Once you have a solid grasp of parameters, you can move on to return values.
Go Deeper
Frequently Asked Questions
What is Parameters in CS Thinking?
Named values passed into a function when calling it, allowing the same function to operate on different data.
Why is Parameters important?
Transforms a function from doing one thing to doing many related things.
What do students usually get wrong about Parameters?
Parameter (in definition) vs. argument (in call)โoften used interchangeably.
What should I learn before Parameters?
Before studying Parameters, you should understand: function.