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 trialyadin michaeli
Courses Plus Student 5,423 Pointswhen it true or false
Hello, i actually didn't really get it when it true or when it false?
does somebody can explain it to me please?
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! In an "OR" statement, if any one of the expressions is true the entire thing will evaluate to true. In an "AND" statement every one of the expressions must be true for the entire thing to evaluate to true.
Hope this helps!
yadin michaeli
Courses Plus Student 5,423 Pointsthank you very much all! :)
Mark Casavantes
Courses Plus Student 13,401 PointsMark Casavantes
Courses Plus Student 13,401 PointsHi Yadin,
You use true and false when you are using boolean variables.
I am not sure what you mean by "it".
== Returns true if the expression on the left evaluates to the same value as the expression on the right. != Returns true if the expression on the left does not evaluate to the same value as the expression on the right. < Returns true if the expression on the left evaluates to a value that is less than the value of the expression on the right. <= Returns true if the expression on the left evaluates to a value that is less than or equal to the expression on the right.
In this sample uses boolean and true/false.
If you have other questions, please let me know.
Happy Coding,
Mark