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

Why my right/wrong questions are not print in the DOM ?

Hi guys !

My code is already good I think. Even if, when i want to print the good or wrong answers of my quiz, they are not print in the DOM. And i do not know why. Can someone help me, please ? No error indicated in the console.

Thanks in advance !

Here's my code : https://teamtreehouse.com/workspaces/39576802

If you want to share a workspace you need to take a snapshot. It is the icon in the upper right corner that looks like a camera.

2 Answers

Excuse me, I did not know ! Here's the snapshot : https://w.trhou.se/c9ezwkciws

You are only calling the print function on your first statement

html = print("You got " + isGood + " question(s) right.");

However, if you build your html then call print you should be good with all statements

numbersAnswers(quizHarryPotter);
html = "You got " + isGood + " question(s) right.";
html += "<h2> You got these questions correct: </h2>";
html += build(goodAnswers);
html += "<h2> You got these questions wrong: </h2>";
html += build(wrongAnswers);
print(html)