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!
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
Robertas Micius
2,267 PointsHiding answers in javascript Quiz script
Hi people. I wonder how do I need to hide answer for questions made with javascript? Because its easy to find answers in source code.

Justin Deardorff
8,448 PointsIf you want to completely obscure it you would typically retrieve it from a back-end server or database on request instead of storing it directly in client-side javascript. There are steps you can take to obscure your javascript a bit but if it's on the client side it will always be able to be found.

Robertas Micius
2,267 PointsJustin, so there is no other way I can store them safe and they wont be found without using back-end?

Robertas Micius
2,267 PointsTsenko. If you make Quiz script with javascript where is questions and answers. User will mark in website which one is answer and later it will show how many correct answers and how many not. But if you make quiz with javascript, you need to make questions and give them right answers. In source code, if you go to fx: treehouse . com/questions.js there you can find all answers in javascript file.
Tsenko Aleksiev
3,819 PointsTsenko Aleksiev
3,819 PointsI think....I don't understand. Can you please clarify a bit? :)