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:

1. if (!done && (col == 0 || col == 3)) {
2. // ...Do something...
3. }