The unary operators take one operand. The increment (++) and decrement (--) operators in
this group are prefix operators, which means that they appear before the operand in an
expression. The prefix operators differ from the their postfix counterparts in that the
increment or decrement operation is completed before the value of the overall expression is
returned. For example, the following code shows how the value of the expression xNum++ is
returned after the value is incremented.
this group are prefix operators, which means that they appear before the operand in an
expression. The prefix operators differ from the their postfix counterparts in that the
increment or decrement operation is completed before the value of the overall expression is
returned. For example, the following code shows how the value of the expression xNum++ is
returned after the value is incremented.
var xNum:Number = 0;
trace (++xNum); // Output: 1
trace (xNum); // Output: 1
All of the operators in this table have equal precedence.
| Operator | Operation performed |
| ++ | Increment (postfix) |
| -- | Decrement (postfix) |
| + | Unary + |
| ! | Unary - (negation) |
| T(x) | Type cast |
| typeof | Returns type information |
| void | Returns undefined value |