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 Passing an Argument to a Function

Do we make up our own parameter? I don't understand this question.

I'm sorry I don't even know what to ask, I'm just lost on this question I don't know what they're looking for. Do we make up parameters? Like do we make up a whole function like in the previous video?

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

For task one, you're not really making up parameters, the challenge wants you to create a simple function (name returnValue) with one argument and just return the argument.

You will use var to create the function.

var returnValue = function(arg) {
  return arg;
}

I hope this makes sense. If not, I recommend going back over some of the videos before moving on, as functions are a very large part of JavaScript programming.

Keep Coding! :)

Ah, thank you, I just didn't understand what they are looking for. Yes I think I'll go through the functions section again. Thank you!!

On the side note. Parameter and argument is used as the same thing, but they are a bit different. Parameter is used when you are building the function. It is a placeholder for a potential value. Argument is the actual value you will use later when the function is called. It helps me to remember the difference.

Thank you!