Promptles
Programming Basics

Parameter

beginner

Definition

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