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 Solution

Gerry K
Gerry K
5,877 Points

Score count not working

Here's a screenshot http://w.trhou.se/0ntljw8kry

When a question is answered correctly, the count which was set to 0 is not being increased.

Thank you

1 Answer

Hi there!

You're logic is fine - works just as expected. The problem is in the output. You write the variable count to the document before calling the quiz function and then don't change that line of HTML again. So whilst the count variable is updated in JS, and is logged to the console, it doesn't get updated on the page.

Hope it helps :)