Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Creating Reusable Code with Functions Giving Information to Functions

Reuben Lecky
Reuben Lecky
7,690 Points

Function Parameters

How does the function know what the parameters mean, such as: upper, width, length, and unit. These make sense to me but are these special words in JavaScript.

Ali .
Ali .
15,521 Points

Good question.

No is not special words for javascript. it's like a variable and you can write any words, and I think should be using them on include of the functions only.

2 Answers

jrabello
jrabello
17,917 Points

In programming languages there are what we call "tokens", those tokens have a semantic meaning, there are SOME reserved keywords that cannot be used as a variable name like -> "function"

"function" is a reserved keyword, all the others you said are not

Steven Parker
Steven Parker
218,487 Points

As Ali pointed out, the words have no special meaning to JavaScript, but it's good programming practice to use parameter names that reflect what the parameter is used for. For example, a function that sets an element width would work just as well if the parameter was named "banana", but it would be easier to read and understand the code if it is named "width".