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

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

Hello

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!

Hi Liam, Thanks for the quick response.. I edited my code to make sure my question is clearer..