DEV Community

Cover image for Difference between parameter and argument
icncsx
icncsx

Posted on

3 1

Difference between parameter and argument

The two terms are used interchangeably in conversation, but they mean different things. You pass arguments when calling a method. And you use parameters within the method body.

As most if not all programming languages are copy-by-value, the two are equivalent, only differing in the context. The two terms exist to distinguish whether you are talking about a method definition or a method call. When you're calling a method, you pass in arguments. When you're actually in the method body, you are using parameters. Arguments get copied-by-value to parameters.

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay