Logical Operators

Supported logical operators to manipulate and combine Boolean values and to construct conditional statements.

Operator

Name

Description

Applicable Data Types

Return Data Type

Example

||

OR

Returns the result of combining Boolean values using a logical OR. If one value or expression contained in the OR statement evaluates to true, the OR expression returns true.

Boolean

Boolean

true || false;

//returns true

&&

AND

Returns the result of combining Boolean values using a logical AND. If both values or expressions in the AND statement evaluate to true, the AND expression returns true.

Boolean

Boolean

true && false;

//returns false

!

NOT or Inversion

Negates the specified Boolean value. Applying the NOT operator to an expression that evaluates to true will return false.

Boolean

Boolean

!true;

//returns false



Legal Notices | Your Privacy Rights
Copyright © 2019, 2022

Last Published Thursday, August 25, 2022