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 Solution

Sandra AlSaig
Sandra AlSaig
Front End Web Development Techdegree Student 11,653 Points

Not able to print the the message on the page.. not sure why. 🤓

I have written the code almost identically .. the difference is that the questions are answered with strings instead of numbers and I added a (.toLowerCase()) to the response variable..

It is not printing the string up on the screen and says ;

Uncaught ReferenceError: correnctAnswers is not defined at quiz.js:28

I have tried it with template literal but that also didn't work. :(

I'm not sure what I'm doing wrong.. Thanks in advance!! 🙏🏼

My code : https://teamtreehouse.com/workspaces/41578023#

1 Answer


I cant know for sure without seeing your code but this error is when a non-existent variable is referenced somewhere.

In your case, that variable is correnctAnswers

What is the cause?

Well it could be multiple things, here is a list to check:

  1. Typo: Did you mean correctAnswers not correnctAnswers
  2. Check that correnctAnswers is declared above line 28, quiz.js
  3. Check that correnctAnswers is in the same scope as the reference.

some more info on MDN

Good Luck!