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 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
231,072 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".