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

What is 'arr'?

What is the purpose and point of arr? I know it's a parameter but what part of the overall code is 'arr' linked to?

3 Answers

It is just an input parameter for the function, it is because you are passing in an array, looping through it then returning a string which joins together the different parts of the array. Does that answer your question?

ehhh. still confusing to me. thanks for you effort. can you word a little differently, please? Also, when you say array and when Dave saids array, are you guys referring to the "var correct" and "var wrong" array?

Whatever you will pass to a function are the parameters of a function and they can be named anything. In this case, "arr", which is also worded to hint that you'll pass in an array. Correct, you are passing in the arrays "correct" and "wrong" which you will create a list for each of them.

It's an array shortcut is arr.