What are booleans?
Booleans are the simplest data type - they can only beTrue or False. Think of them as yes/no answers.
Boolean values are
True and False with capital letters. Using true or false will cause an error!Creating booleans
Booleans often come from comparisons:Comparison operators
These operators compare values and returnTrue or False:
Remember:
= assigns a value, while == compares values. This is a common source of bugs!Common mistakes
Wrong capitalization
Wrong capitalization
Using = instead of ==
Using = instead of ==
What’s next?
Now that you understand data types, let’s learn how to work with them using operators!Operators
Math, comparisons, and more