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
johnny lawma
3,298 Pointswhat does, var correctguess = false; does in these video, i just don't get it.
i just don't get it, why there is var with false, what does it do. Please help i don't get it.
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You have not linked a video, but I'm going to make an educated guess here. I'm betting this is for a quiz of some type or some number guessing game. In those types of cases, we want to assume the answer is incorrect before we actually see the answer. Then, if we see the answer and it's correct, mark it correct.
Much like in school, we don't hand out blank math tests and assume they are all correct until a student shows an incorrect answer and mark it down from 100. We assume a blank answer to be incorrect and mark the correct answers all the way up to a perfect score. Although, I've had some history classes where I wish the first scenario were the way it worked
Hope this helps!