Booleans and Comparison Operators
Produce true and false from comparisons.
Yes or No, True or False
Every decision your program makes starts with a yes-or-no answer. In Dart that answer is a bool, which holds only true or false. 🤔
Declaring a bool
You store a yes-or-no value in a variable typed as bool. It can hold the literal true or the literal false, and nothing else.
bool isReady = true;
bool isDone = false;All lessons in this course
- Booleans and Comparison Operators
- if, else if, and else
- Logical Operators and Short-Circuiting
- The Ternary and switch Expression