Logical operators
Inversion
The inversion operator (!
) returns true
if the operand is false
, and false
if the operand is true
:
Example
Logical and
The and
or &&
expression determines if two values are both true
. It returns true
if both values are true
and false
otherwise:
Example
Logical or
The or
or ||
expression determines if either of the values (or both) are true
. It returns true
if one (or both) of the values are true
.
Example
Last updated