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 Functions Pass Information Into Functions Function Parameters and Arguments

Clarification on parameters and arguments and where to put them?

I think after watching this video a couple times the differences between arguments and parameters are a bit clearer but I would like to run my thinking by someone to see if I am finally understanding this correctly...

Am I right in understanding that an argument is the ACTUAL value and the parameter is the 'placeholder'. It's as if JavaScript's engine is running the code and the programmer is telling the engine, "listen there's a value that WILL be here, but I haven't got to that part of the story yet, please put this parameter in place for now, we will get to the values later."

Then at the bottom when the function is called, the 'argument' comes into play and gives the actual value so the code can complete.

Thanks for sharing your understanding Kendra... your insight really helped me understand the differences and how the two interact :) Cheers!

judygrayland
judygrayland
8,647 Points

A very useful summary, thank you! Using your analogy, Parameter = Placeholder (ie. both starting with P), definitely helps to remember which is is parameter and which is argument :)

Love the insight! Hope your coding journey is going well.

Osman Khan
Osman Khan
7,005 Points

I really need to read the comments more, as this definitely helped me understand it better. Thanks.

4 Answers

Steven Parker
Steven Parker
231,269 Points

I'd say your understanding is exactly correct. :wink:

Happy coding!

You cleared this up for me too!

Matt Partridge
Matt Partridge
3,205 Points

I'm glad I read that, helped me understand it a bit better.

David Lima
David Lima
3,920 Points

This helped a lot, thank you!!