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!

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

Cindy Lea
Cindy Lea
Courses Plus Student 6,497 Points

Solution for this code doesnt work either....anyone figure this one out?

Heres the link to my code. I even downloaded the solution into my workspace & nothing appeaars on my screen when program runs.


Its complaining about line 44.

Thank you for your help.

Josh Alling
Josh Alling
17,172 Points

What is the error message that you are getting?

4 Answers

Steven Parker
Steven Parker
227,114 Points

It worked for me. Plus I didn't see any problems on line 44 (of either file).

Cindy Lea
Cindy Lea
Courses Plus Student 6,497 Points

Maybe its time to reboot & call it a night : ) Will try again. Thank you.

It works, no error. Still having issue?

Owa Aquino
Owa Aquino
19,277 Points

Here's my answer to the challenge.

Hope this help.

To Do.
1. Create at least 3 questions for a quiz using two dimensional arrays.
2. Ask the question using prompt.
3. Return to the HTML page those question answered correctly and those questions answer wrong.

1. Founder of the Apple Inc. - Steve Jobs
2. Author of the book STEAL LIKE AN ARTIST. - Austin Kleon
3. A Front-End Web Designer. - Owa Aquino

var html;
var correctCounter = 0;
var questionsToAnswer = [
    ['Founder of the Apple Inc.', 'Steve Jobs'],
    ['Author of the book STEAL LIKE AN ARTIST.', 'Austin Kleon'],
    ['A Front-End Web Designer.', 'Owa Aquino']
var correctQuestions = [];
var incorrectQuestions = [];

function print(message){

function buildList(arr){
    var listHTML = "<ol>";

        for (var i=0; i < arr.length; i += 1){
            listHTML += "<li>" + arr[i] + "</li>";
        listHTML += "</ol>";
        return listHTML;

for(var i = 0; i < questionsToAnswer.length; i+=1){

    var question =  questionsToAnswer[i][0]
    var answer = questionsToAnswer[i][1]

    var askquestions = prompt(question);

    if(askquestions === answer){
    } else {

html = "You have answer " + correctCounter + " question/s correctly";
html += "<h2> You have answer theses questions correctly:</h2>";
html += buildList(correctQuestions);
html += "<h2> You have answer theses questions wrong:</h2>";
html += buildList(incorrectQuestions);