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 trialoafwifkeiw
1,546 Points1:25: "function as a parameter" OR "function as an argument"?
"you can clearly see function as a parameter..."
Isn't the function an Argument instead or a parameter..? If I'm mistaken please correct and help me get the hang of this :)
2 Answers
oafwifkeiw
1,546 PointsYep. The way I've understood them is:
const exampleFunction = (thisIsAParameter) => console.log(thisIsAParameter);
exampleFunction("thisIsAnArgument");
...but would hope for a comment from teamtreehouse whether I've misunderstood :)
Steven Parker
231,275 PointsI'd agree with you that "argument" is more appropriate to describe something passed during a call, where "parameter" would generally be used to describe the placeholder when the function is being defined.
But it's easy to get those terms reversed and it appears that's what the instructor did here. Good catch!
Steven Parker
231,275 PointsSteven Parker
231,275 PointsYou're understanding is completely correct based on my own JavaScript experience. But I understand if you want official confirmation of the error in the video.
I'd suggest tagging the teacher, but I understand Andrew is no longer with Treehouse. But you might want to report this as a video bug directly to the staff via the Support page. Their response would probably confirm the error in the video. And if you're the first to report it, it could get you the "Exterminator" badge.
Mike Hatch
14,940 PointsMike Hatch
14,940 PointsThis isn't the first time I've heard an instructor use "parameter and arguments" interchangeably. According to MDN parameters are arguments:
Steven Parker
231,275 PointsSteven Parker
231,275 PointsThe MDN usage seems correct to me. A parameter is a name used as a placeholder for an argument which will be passed to the function at a later time.
Mike Hatch
14,940 PointsMike Hatch
14,940 PointsIt's hard to figure because like I mentioned I've seen high profile instructors use them interchangeably like this. It's possible they come from a variety of programming backgrounds before they settled on JavaScript. Wikipedia goes into a bit more depth on the subject:
Source: Parameters and arguments