Logical Operators are on similar ground to comparison operators. They take two items, compare them and perform based on the result. These are the OR, AND and NOT of comparisons.

OR will compare two expressions and produce a true result if

If both expression values are zero, the result will hold a zero value.

An example in action.

AND will compare two expressions and produce a true result if

If one or both expression values are false (zero), then the result will hold a zero value.

An example in action.

NOT will evaluate one expression. If the expression is zero, the result will be true and hold a value of 1. If the expression is non-zero, the result will be false and hold a value of null. null is not zero. It is an empty space.

This is kindof a backwards way of finding a result conidering it is looking for the "non" values. It does come in handy though when that is the desired result you are looking for though.

An example in action.

|| && ! |
OR AND NOT |

OR will compare two expressions and produce a true result if

__either__expression has a true value (non-zero). The result will have the value of the__first__true expression value.If both expression values are zero, the result will hold a zero value.

AND will compare two expressions and produce a true result if

__both__expression values have a true value (non-zero). The result will have the value of the__last__true expression value.If one or both expression values are false (zero), then the result will hold a zero value.

NOT will evaluate one expression. If the expression is zero, the result will be true and hold a value of 1. If the expression is non-zero, the result will be false and hold a value of null. null is not zero. It is an empty space.

This is kindof a backwards way of finding a result conidering it is looking for the "non" values. It does come in handy though when that is the desired result you are looking for though.