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 1


Is there anyone else out there that didn't even know where to begin with this? I don't even know how to start.

2 Answers

Peter Quin
Peter Quin
3,203 Points

Start by keeping it simple, one question and one answer, you could begin by having them as just single variables (change to arrays later), use something like an 'if/else' statement to compare if the answer, that you would need to collect via a prompt, is the same as the answer in your variable / array.

Sometimes its a bit overwhelming when starting a project, but what you need to remember is that its all made up of small steps. Work out what you need ('I need answers & questions' = two arrays, 'I need to compare them' = if/else statement) break it down and try to apply what you know to each step.

And message again if you have more question or get stuck (we all do). Hope that helps

Shawn Williams
Shawn Williams
14,762 Points

I found it very helpful to make a list of what I needed to do to program the quiz. I commented this list in my text editor at the top of the code I needed to write. Here is what I listed that really helped me stay organized and be able to write out the code for the quiz step by step.


  1. Create a two dimensional array to build quiz with at least 3 questions
  2. Each element of the array will represent one question and one answer.
  3. Use a loop to cycle through each question and evaluate
  4. Use a conditional statement to check answers
  5. Print how many correct answers received to screen */