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.
Sandra AlSaigFront End Web Development Techdegree Student 11,501 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!! 🙏🏼
Liam ClarkeTreehouse Moderator 19,873 Points
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
What is the cause?
Well it could be multiple things, here is a list to check:
- Typo: Did you mean
- Check that
correnctAnswersis declared above line 28, quiz.js
- Check that
correnctAnswersis in the same scope as the reference.