Difference between revisions of "Operator Reference"
→Logical Operators
imported>Plplecuyer (→Dot) |
imported>Mattamue |
||
Line 96: | Line 96: | ||
Logical operators evaluate to true or false values, based on their [[Expression Reference|expressions]]. | Logical operators evaluate to true or false values, based on their [[Expression Reference|expressions]]. | ||
*The NOT operator (!) will be true if its single expression (to the left of the operator) is false, and false if it is true. | *The NOT operator (!) will be true if its single expression (to the left of the operator) is false, and false if it is true. | ||
*The OR operator (||) will be true if one of the expressions to its left and right are true, and will short-circuit if the | *The OR operator (||) will be true if one of the expressions to its left and right are true, and will short-circuit if the left expression is true (it will not evaluate the right expression at all). | ||
*The AND operator (&&) will be true if both of the expressions to its left and right are true, and will short-circuit if the | *The AND operator (&&) will be true if both of the expressions to its left and right are true, and will short-circuit if the left expression is false (it will not evaluate the right expression at all). | ||
Examples: | Examples: |