QamoosTech
Programming FundamentalsBeginner

Parameter vs Argument

Pronunciationpuh-RAM-ih-ter versus AR-gyuh-ment

Definition

A parameter is the name in the function definition. An argument is the real value you pass when you call it.

Where you hear it

Code reviews, documentation, and error messages such as "expected 2 arguments, got 1".

Examples

  • The function takes two parameters: name and age.
  • You passed three arguments, but it expects two.

Common mistake

Using the two words as if they were identical. People usually understand you, but in interviews the difference is a common question.