Logical operators
You can invert or combine boolean expressions using the logicaloperators.
Operator | Meaning |
---|---|
!expr | inverts the following expression (changes false to true, and vice versa) |
|| | logical OR |
&& | logical AND |
Here’s an example of using the logical operators:
if (!done && (col == 0 || col == 3)) {
// ...Do something...
}