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 Callback Functions in JavaScript Introduction to Callback Functions Anonymous Functions

1: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

Yep. 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
Steven Parker
231,122 Points

You'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. :beetle:

Mike Hatch
Mike Hatch
14,940 Points

This isn't the first time I've heard an instructor use "parameter and arguments" interchangeably. According to MDN parameters are arguments:

param The name of an argument to be passed to the function. A function can have up to 255 arguments.

Steven Parker
Steven Parker
231,122 Points

The 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
Mike Hatch
14,940 Points

It'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:

The terms parameter and argument may have different meanings in different programming languages. Sometimes they are used interchangeably, and the context is used to distinguish the meaning.

Source: Parameters and arguments

Steven Parker
Steven Parker
231,122 Points

I'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!