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 trialAlsaig Sandra
Front End Web Development Techdegree Graduate 15,434 PointsNot 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!! 🙏🏼
1 Answer
Liam Clarke
19,938 PointsHello
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:
- Typo: Did you mean
correctAnswers
notcorrenctAnswers
- Check that
correnctAnswers
is declared above line 28, quiz.js - Check that
correnctAnswers
is in the same scope as the reference.
Good Luck!
Alsaig Sandra
Front End Web Development Techdegree Graduate 15,434 PointsAlsaig Sandra
Front End Web Development Techdegree Graduate 15,434 PointsHi Liam, Thanks for the quick response.. I edited my code to make sure my question is clearer..