2️⃣

# 3.2 Logical Operators

## What Are Logical Operators?

Logical operators are used to combine two conditionals. JavaScript includes the following logical operators.

### Logical Operators

NamePurpose
&&
(AKA the `AND` Operator) Checks whether two operands are `non-zero`. If one operand is `zero` then this operator returns 0 or `false` and 1 or `true` otherwise. (Note: 0, false, undefined, null, or "" is considered `"zero"`)
||
(AKA the `OR` Operator) Checks whether any one of the two operands is `non-zero`. If ALL operands are `zero` then this operator returns 0 or `false` and 1 or `true` otherwise. (Note: 0, false, undefined, null, or "" is considered `"zero"`)
!
(AKA the `NOT` operator) It reverses the Boolean result of the operand or condition.

## Examples

``````let a = 5, b = 10;

(a != b) && (a < b); // returns true

(a > b) || (a == b); // returns false

(a < b) || (a == b); // returns true

!(a < b);            // returns false

!(a > b);            // returns true``````

# Previous Section

1️⃣
3.1 Relational Operators

# Next Section

3️⃣
3.3 If, Else, Else if

⚖️