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 Loops, Arrays and Objects Tracking Multiple Items with Arrays Build a Quiz Challenge, Part 2 Solution

Mariela Napoles
Mariela Napoles
13,434 Points

paramater "arr" under function buildList() question

function BuildList(arr) { ... }

referring to Dave's code, what is the value of the parameter 'arr'? Will it depend on the correct or wrong answers? If not can you please tell me what is the value for the arr? Thank you so much.

2 Answers

Hi Mariella, the parameter 'arr' is like a variable you create when declaring the 'BuildList' function. When you call the function you pass in an argument into it. That argument is like the value which is stored in a variable(the 'arr' parameter). From what I can recall about this particular course, the 'BuildList' function has an 'arr' parameter which represents an array of correct/wrong answers. So depending on what array you pass into the function when calling it, will determine the value of 'arr'.

Mariela Napoles
Mariela Napoles
13,434 Points

Alright I unerstand. Thank you for answering Osaro!