Page 20 - LoudOffice_Guide-to-HTML_Part-II_Advanced.PDF
P. 20

++    Unary increment: this operator only takes one operand. The operand's
                                value is increased by 1. The value returned depends on whether the ++
                                operator is placed before or after the operand; e.g. ++x will return the
                                value of x following the increment whereas x++ will return the value of x
                                prior to the increment.
                          --    Unary decrement: this operator only takes one operand. The operand's
                                value is decreased by 1. The value returned depends on whether the --
                                operator is placed before or after the operand; e.g. --x will return the
                                value of x following the decrement whereas x-- will return the value of x
                                prior to the decrement.
                           -    Unary negation: returns the negation of operand.

               Comparison
               A comparison operator compares its operands and returns a logical value based on whether
               the comparison is true or not. The operands can be numerical or string values. When used
               on string values, the comparisons are based on the standard lexicographical (alphabetic)
               ordering.

                        ==   "Equal to" returns true if operands are equal.
                         !=  "Not equal to" returns true if operands are not equal.
                         >   "Greater than" returns true if left operand is greater than right operand.
                             "Greater than or equal to" returns true if left operand is greater than or
                        >=
                             equal to right operand.
                         <   "Less than" returns true if left operand is less than right operand.
                        <=   "Less than or equal to" returns true if

               Boolean
               Boolean operators are typically used to combine multiple comparisons into one conditional
               expression. For example, you might want to test two different computations: for example,
               (24 * i) and (12 + p + 3). A boolean operator takes two operands, each of which has a true
               or false value, and returns a true or false result.


                        &&   "And" returns true if both operands are true.
                         ||  "Or" returns true if either operand is true.
                             "Not" returns true if the negation of the operand is true (e.g. the operand is
                         !
                             false).
                             "Greater than or equal to" returns true if left operand is greater than or
                        >=
                             equal to right operand.
                         <   "Less than" returns true if left operand is less than right operand.
                             "Less than or equal to" returns true if left operand is less than or equal to
                        <=
                             right operand




               Assignment
               The assignment operator (=) lets you assign a value to a variable. You can assign any value
               to a variable, including another variable (whose value will be assigned). Several shorthand
               assignment operators allow you to perform an operation and assign its result to a variable
               in one step.



               LoudOffice.com Guide to HTML – Part II                                               Page 20
   15   16   17   18   19   20   21   22   23   24   25