Logical Operators in ActionScript

Notes:

Logical Operators in ActionScript Programming Language:
Logical operators are also known as logical connectives. They are used to connect one or more conditions. They accept Boolean operands, on evaluation they yield the result either true or false.

&&: Logical And Operator:
If both LHS and RHS operands are true then the result will be true, in all other cases the result will be false

&& (Logical And) truth table:
P Q P && Q
T T T
T F F
F T F
F F F

||: Logical Or Operator:
If both LHS and RHS operands are false then the result will be false, in all other cases the result will be true

|| (Logical Or) truth table:
P Q P || Q
T T T
T F T
F T T
F F F

!: Logical Not Operator (Negation):
If the given operand is true, then the result will be false; vice versa.

!(Logical Not) truth table:
P !p
T F
F T

Example Code:
trace("Logical operators demo");
trace(true && true); // true
trace(true && false); // false
trace(false && true); // false
trace(false && false); // false

trace(true || true); // true
trace(true || false); // true
trace(false || true); // true
trace(false || false); // false

trace(!(true)); //false
trace(!(false)); //true

trace( (3<4) && (4<5) ); //true
trace( (3>4) && (4<5) ); // false
trace( (3>4) || (4>5) ); //false
trace( (3<4) || (4>5) ); //true

trace(!(2<4)); //false
trace(("Hello"=="Hello") && ("World"=="World"));//true