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.
Spencer Renfro2,767 Points
What does assigning a boolean value actually tell the computer?
After assigning a boolean value of true and false with variables, prompt diaglog for user input and everything, what do the values of true and false truly tell the computer? What I mean is if you can set the value of the variable to be false and write to the console to say it is in fact true but given the false boolean value in the code, then is assigning these values of true and false only intended on making it easier for the human to read?
Steven Parker210,474 Points
A boolean is like any variable in that it stores data. The restriction is that the data can only have two possible values, true or false.
But this statement is quite remarkable:
"...you can set the value of the variable to be false and write to the console to say it is in fact true..."
That doesn't seem possible, can you provide a code example that does this?