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

Quierra Wells
Quierra Wells
7,705 Points

Is the "upper" parameter something the instructor made up?

The explanation isn't really sinking in for me.

How is the value of "upper" being defined? Is it pre established by MDN similar to "toUpperCase"?

2 Answers

Francisco Ruiz
Francisco Ruiz
14,213 Points

Hi Quierra - If you are referring to this part of the code: function getRandomNumber( upper){

then "upper" could be anything, you could name it "higher" or "bob", as long as you refer to it with the same name within the function itself. It is similar to stating a variable that will be used in the context of the function, and is being set outside of the function when the function is called.

Quierra Wells
Quierra Wells
7,705 Points

Thanks that was very helpful!