Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics (Retired) Creating Reusable Code with Functions Giving Information to Functions

Pavle Lucic
Pavle Lucic
10,801 Points

Difference between argument and parameter?

What is the difference between argument and parameter?

2 Answers

Hi Pavle,

Arguments are what get passed into function calls.

Parameters are what the function will accept, when called.

// function defined with two parameters
function foo(meat, fruit) {
  console.log("For meat, you picked: " + meat);
  console.log("For fruit, you picked: " + fruit);
}

// function called with two arguments
foo("bacon", "apple");
Pavle Lucic
Pavle Lucic
10,801 Points

Tnx, I realized that after watching the next video :) Cheers Robert!

Chris Harkin
Chris Harkin
1,104 Points

Hi @Robert Richey thanks for this answer but am still a little confused.

Would I be correct in saying the parameters are like place holders for the values and the arguments are the actual values.

I actually had the same question. I just remember that arguments is like "arguing" against the function by supplying your "arguments" against function's parameters. Sounds silly, but that's how I remember the difference :)