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 trialKendra Coffey-Wolfgang
2,445 PointsClarification 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.
judygrayland
8,647 PointsA 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 :)
Esther AlQaisi
2,311 PointsLove the insight! Hope your coding journey is going well.
Osman Khan
7,005 PointsI really need to read the comments more, as this definitely helped me understand it better. Thanks.
4 Answers
Steven Parker
231,275 PointsI'd say your understanding is exactly correct.
Happy coding!
Sherri Holmes
Full Stack JavaScript Techdegree Student 8,499 PointsYou cleared this up for me too!
Matt Partridge
3,205 PointsI'm glad I read that, helped me understand it a bit better.
David Lima
4,131 PointsThis helped a lot, thank you!!
moises hernandez
2,878 Pointsmoises hernandez
2,878 PointsThanks for sharing your understanding Kendra... your insight really helped me understand the differences and how the two interact :) Cheers!