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

Jacob Smith
Jacob Smith
10,926 Points

Javascript Quiz Challenge -- part 1

I'm stuck on part one of this quiz. Needing some help.

// Two-dimensional array with questions and answers 

var questionsArray = [
  [ 'How many states make up the United States of America?', 50  ],
  [ 'Who is our current vice president?', 'Joe Biden' ],
  [ 'What is 12 times 12 divided by  6?', 24 ],
  [ 'Who was the second president of the United States?', 'John Adams' ]
];


function songList( songs ) {
  htmlList = '<li>'
    var questionPrompts = prompt(questionsArray[i][0]);
    htmlList += questionPrompts + '</li>'
} 


for ( var i = 0, i <= songs.length, i = 1 ) {
  var questionPrompts = prompt(questionsArray[i][0]);

};

function print(message) {
  document.write(message);
}

2 Answers

Jacob, If you need help, please ask a specific question. Don't ask folks to hunt down a video, watch it, look at your code, and try to guess what you need.

Jacob Smith
Jacob Smith
10,926 Points

I am told to ask a series of questions, and evaluate each answer. My program should be able to track the correct answers as well as the incorrect ones and display them on the page once the quiz prompts are finished.

Sorry about not typing this out. I didn’t realize how that was perceived.

You're still not asking a specific question, Jacob. Don't ask folks to evaluate your program against the assignment--that's your job. Ask specific questions to help you do it.