Logical Operators
These are operators that perform logical operations on Boolean values and return a Boolean result.
| Name | Maths | Operator | Example | Note |
|---|---|---|---|---|
| Logical NOT | ! |
!x |
Inverts the boolean value. | |
| Logical AND | && |
x && y |
Returns true if both operands are true. | |
| Logical OR | || |
x || y |
Returns true if at least one operand is true. | |
| Logical XOR | ^ |
x ^ y |
Returns true if operands are different. | |