Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Loops, Arrays and Objects Tracking Multiple Items with Arrays Build a Quiz Challenge, Part 1

HELP. SO LOST

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,200 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,750 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 */